$results = @()
foreach ($vm in Get-Vm)
{
  foreach ($vmHardDisk in $vm | Get-HardDisk)
  {
  $result = "" | select vmName,NumCpu,MemoryGB,harddiskname,HardDiskCapacityGb
  $result.vmName = $vm.Name 
  $result.NumCpu = $vm.NumCpu
  $result.MemoryGB = $vm.MemoryGB
  $result.HardDiskName = $vmHardDisk.Name
  $result.HardDiskCapacityGb = [System.Math]::Round($vmHardDisk.CapacityGB, 0)
  $results += $result
  }
}
$results | ft -AutoSize