Yes, the VirtualMachine object contains, under the Runtime.Host property, a MoRef to the host on which the VM is running or assigned.
The script could then be something like this:
$report = @()
$vms = Get-VM | Get-View
foreach($vm in $vms){
foreach($dev in $vm.Config.Hardware.Device){
if(($dev.gettype()).Name -eq "VirtualDisk"){
if(($dev.Backing.CompatibilityMode -eq "physicalMode") -or
($dev.Backing.CompatibilityMode -eq "virtualMode")){
$row = "" | select VMName, VMHost, HDDeviceName, HDFileName, HDMode, HDsize
$row.VMName = $vm.Name
$row.VMHost = (Get-View $vm.Runtime.Host).Name
$row.HDDeviceName = $dev.Backing.DeviceName
$row.HDFileName = $dev.Backing.FileName
$row.HDMode = $dev.Backing.CompatibilityMode
$row.HDSize = $dev.CapacityInKB
$report += $row
}
}
}
}
$report