Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 175326

List VM name and sum of (provisioned) VM disk size and export it

$
0
0

Hello,

 

I need to list all VM:s and their provisioned disk space. I can do it with this command:

get-vm * | foreach-object {write-host "$_`t" (Get-HardDisk -vm $_ | Measure-Object -Property CapacityGB -Sum).sum.ToString()}

 

(If there is more elegant way to do this, please feel free to enlight me )

 

The problem is that I'm unable to export this data. Adding

| export-csv ... or

> list.txt

to end of line creates empty file and prints output to console.

 

How could I make export work correctly (or way I want)?


Viewing all articles
Browse latest Browse all 175326

Trending Articles



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