May 18 2018 05:01 AM
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 -Title "Select Your Region"
when i print out the value of the command, it looks like this:
-> Parameter Set to Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels.PSResourceProviderLocation
Unfortunately this does not correspond to any value that i can use in the script. For example, I should be able to pass the name.
"West Europe"
Thanks for any Ideas.
Greetings
Peter
May 18 2018 10:45 AM
SolutionThe 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.
May 21 2018 11:16 PM
Thx a lot it works fine.