Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 201745

Re: Need a power-shell script to ..

$
0
0

Looks like you are using an older PowerCLI version, the CapacityGB was introduced in one of the previous PowerCLI builds.

Try to upgrade.

If an upgrade is not possible, you can do

 

Get-Datacenter-NameMyDC|Get-VM|
Sort-Object-PropertyName|
Get-HardDisk|
Select@{N="VM";E={$_.Parent.Name}},Name,@{N="CapacityGB";E={[int]($_.CapacityKB/1MB)}},
@{N="Type";E={[string]::Join('/',($_.DiskType,$_.StorageFormat,$_.Persistence))}},
@{N="Comment";E={''*25}} |
Export-CsvC:\HD-report.csv-NoTypeInformation-UseCulture

This also sorts the VM on their Name property.


Viewing all articles
Browse latest Browse all 201745

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>