Ok, then try it like this
$rdms=Get-VM|Get-HardDisk|where {"RawPhysical","RawVirtual"-contains$_.DIskType}"VM with RDM: $(($rdms | Sort-Object -Property {$_.Parent.Name} -Unique).Count)"
"Total RDM size GB $($rdms | Measure-Object -Property CapacityGB -Sum | Select -ExpandProperty Sum)"