Hi
I tried to get the capacity in TB from some examples on the net but no luck.
Code:
Get-VM | Select @{N="VM";E={$_.Name}},@{N="Datastore";E={
($_ | Get-Datastore | %{$_.Name}) -join ","}},@{ N="VM SizeGB"; E={
($_ | Get-harddisk | measure-object -property CapacityGB -sum).Sum / 1024}}
Thanks
This seems to work for me
Get-VM | Select @{N="VM";E={$_.Name}},
@{N="Datastore";E={($_ | Get-Datastore | %{$_.Name}) -join ","}},
@{ N="VM SizeTB"; E={[math]::Round(($_ | Get-harddisk | measure-object -property CapacityGB -sum).Sum/1KB,2)}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
This seems to work for me
Get-VM | Select @{N="VM";E={$_.Name}},
@{N="Datastore";E={($_ | Get-Datastore | %{$_.Name}) -join ","}},
@{ N="VM SizeTB"; E={[math]::Round(($_ | Get-harddisk | measure-object -property CapacityGB -sum).Sum/1KB,2)}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks Luc...This works for me.