I have json that I get from an API that returns a value like this
[{
"Location": "/xxx/005D2"
}, {
"Location": "/xxx/020D2"
}, {
"Location": "/xxx/061D2"
}, {
"Location": "/xxx/086D2"
}, {
"Location": "/xxx/100D2"
}]
When I call the URL and access the variable
$installs= Invoke-RestMethod -Uri $installLocation -Method Get;
I get the following
Location
--------------
/xxx/100D2
/xxx/120D2
/xxx/110D2
etc
How can I loop through these so I only access 1 location at a time?
$installs | foreach { $_.location; };