How To Grab All VMs in Hyper-V / Cluster and their disks sizes

How To Grab All VMs in Hyper-V / Cluster and their disks sizes

April 5, 2019

Change the exported path file.

Get-VM -ComputerName SERVER1,SERVER2,SERVER3 | ForEach-Object {Get-VHD -ComputerName $_.ComputerName -VMId $_.VMId} | ConvertTo-HTML -Property path,computername,vhdtype,@{label='Size(GB)';expression={$_.size/1gb -as [int]}},@{label='FileSize(GB)';expression={$_.filesize/1gb -as [int]}} > C:\Install\VHDxUsageReport.html

Size: Alocated VM disk.

FileSize: Current VM Disk usage.

Leave a Comments

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

Copyright ©2023 All rights reserved