List VM's with RDM

I was asked if it was possible to list all VM's with Raw Disk Mappings on twitter, a quick search of the VI Toolkit community showed that LucD had already achieved this, I have copied the code below for reference:

Connect-VIServer MYVISERVER
$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"){
$row = "" | select VMName, HDDeviceName, HDFileName
$row.VMName = $vm.Name
$row.HDDeviceName = $dev.Backing.DeviceName
$row.HDFileName = $dev.Backing.FileName
$report += $row
}
}
}
}
$report