Extracting Value from List and Storing in Variable

There will be time where you need to select a given value from list of value.

Let’s say, we want to store a azure location on to a variable called x.

We first store the value from Get-Azurelocation and Select Displayname. But

Let’s first find a way to extract , Get-AzureLocation will give full list of the Location , then pipe the result to Select and list out the DisplayName value.

As show here, it displays with the heading.

 


Let’s store the value and see what PowerShell offers in terms of extracting value from variable.

As seen above, the result set is stored with properties as part of it.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s