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

Join the Conversation

1 Comment

Leave a comment

Leave a Reply to Admin Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.