I need to do a get-view on all the hosts in a cluster, I know I can use the get-vmhost -location to get all the hosts then do a get-view on each one. I found that if I do a get-view (get-cluster testCluster) this returns a MoRef equal to ClusterComputeResource-domain-c31 , when I do a get-view -viewtype hostsystem on a host in the same cluster, the parent returned is the moref from the get-view on the cluster. So I tied to do a:
get-view -viewtype hostsystem -filter @{"Parent"="ClusterComputeResource-domain-c31"}
But this doesn't return anything. How can I use the filter option to return a view of all the hosts in a cluster?
Thanks