Get Datastore size and Host LUN ID

This post was originally published on this site

Hi,

 

Please help, how can I get Datastore Size and Host LUN ID from the below script

 

Get-View ViewType Datastore PipelineVariable ds | ForEach-Object Process {

    $ds.Host | ForEach-Object Process {

        New-Object TypeName PSObject Propert ([ordered]@{

            Datastore = $ds.Name

            DatastoreSize = $ds.CapacityGB

            Host = (Get-View Id $_.Key Property Name).Name

            Mounted = if($_.MountInfo.Mounted){Mounted}else{Unmounted}

            Datastore Connectivity = if($_.MountInfo.Accessible){Connected}else{Not Connected}

            Mount Point = $_.MountInfo.Path

        })

    }

}

Leave a Reply

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