No error, but it will not list the datastores that are not part of a datastorecluster.
If you want all datastores, you could do
Get-Datastore |
Select Name,@{N='DatastoreCluster';E={Get-DatastoreCluster -Datastore $_ | Select -ExpandProperty Name}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You could tackle this in reverse, something like
foreach($dsc in Get-DatastoreCluster){
Get-Datastore -Location $dsc |
Select Name,@{N='DatastoreCluster';E={$dsc.Name}}
}
This assumes all datastores belong to a datastorecluster
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for the quick reply LucD! We have a few datastores that are not part of a cluster, will the script just return a null value? or would it error out?
No error, but it will not list the datastores that are not part of a datastorecluster.
If you want all datastores, you could do
Get-Datastore |
Select Name,@{N='DatastoreCluster';E={Get-DatastoreCluster -Datastore $_ | Select -ExpandProperty Name}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
This CMD ran but did not display any results in the datastorecluster column.
Which PowerCLI version are you running ?
Do a
Get-PowerCLIVersion
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
PowerCLI 5.0
That explains, the Get-DatastoreCluster cmdlet isn't available in that version.
Can you upgrade ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference