I am running a command that queries my storage array for a list of items. The output gets stored as follows
$ls_xtrem_clusters = Get-XtremClusters
write-host $ls_xtrem_clusters
This results in the output
@{href=https://192.168.1.1/api/json/v2/types/clusters/1; name=cluster1}
What I am trying to do is get a list of the names only. So if there were 3 clusters, I want an array that contains the values cluster1, cluster2, cluster3. This is dynamic content, so I need to be able to extract the data from the values returned by the Get-XtremClusters command.
I tried this
$ls_xtrem_clusters = Get-XtremClusters
$ls_xtrem_cluster | select-object name | %{write-host $_}
Which gave me
@{name=cluster1}
So my question is, how do I extract cluster1 (or if multiple exist cluster1, cluster2, cluster3) and put it in an array?
(Get-XtremClusters).Name