Forum Discussion

peter.kiehn's avatar
peter.kiehn
Copper Contributor
May 18, 2018
Solved

Output parameters from Get-AzureRmLocation| Grid View and set them as variables

Hello Folks, in a script I must be able to select the Azure region and then set it as a variable. The line looks like this so far: $Region = Get-AzureRmLocation | Out-GridView -PassThru -Titl...
  • VasilMichev's avatar
    May 18, 2018

    The output of Out-GridView is the full object type, if you want a specific property use this instead:

     

    $Region = Get-AzureRmLocation | Out-GridView -PassThru -Title "Select Your Region" | select -ExpandProperty Name

     

    where Name is the property you need.