The Daily Shaarli

All links of one day in a single page.

December 5, 2020

powershell - How to Get Actual Hard Disk Memory of A VM? - Stack Overflow
Get-VM | ForEach { $Vm = $_; $_.HardDrives } | ForEach {
    $GetVhd = Get-VHD -Path $_.Path
    [pscustomobject]@{
        Vm = $Vm.Name
        Name = $_.Name
        Type = $GetVhd.VhdType
        ProvisionedGB = ($GetVhd.Size / 1GB)
        CommittedGB = ($GetVhd.FileSize / 1GB)
    }
}