PowerCLI – Get-Datastore Naa and Capacity

simple script to extract fc naa and capacity info

[code language=”powershell”]
$AllDS = Get-Datastore
$results = @()
foreach ($ds in $AllDS) {
$dsview = $ds | Get-View
$resultsarray = "" | Select "DatastoreName","CanonicalName","CapacityGB","FreeSpaceGB"
$resultsarray."DatastoreName" = $ds.Name
$resultsarray."CanonicalName" = $dsview.info.vmfs.extent
$resultsarray."CapacityGB" = $ds.CapacityGB
$resultsarray."FreeSpaceGB" = $ds.FreeSpaceGB
$results += $resultsarray
}
$results | Sort-Object DatastoreName
[/code]

1 thought on “PowerCLI – Get-Datastore Naa and Capacity”

Leave a Reply

Your email address will not be published. Required fields are marked *