I want to know, to which vCenter Cluster that a datastore belongs to.
Cluster Name shows blank, am i missing something
Get-Datastore | Select Name, Datacenter,
@{N="Cluster";E={Get-Cluster $_.Name}},
@{N="CapacityInGB";E={[math]::round($_.CapacityGB)}},
@{N="Provisioned (GB)"; E={[math]::round(($_.ExtensionData.Summary.Capacity - $_.ExtensionData.Summary.FreeSpace + $_.ExtensionData.Summary.Uncommitted)/1GB,2) }},
@{N="FreeSpaceInGB";E={[math]::round($_.FreeSpaceGB)}}
Please help
You're retrieving datastore names. Your example won't work because Get-Cluster $_.Name in your script is the name of the datastore, which won't work. Get-Cluster wants the name of of an actual Cluster, and not a datastore name.
I want to know, which vCenter Cluster that Datastore belongs to
Hope this helps
get-datastore "datastorename" | get-vmhost | get-cluster
how do i modify the above script ?