Powershell or PowerCLI VMDK-to-DriveLetter

85 Views Asked by At

I've been fighting the 'problem' of matching Windows drive letters to VMDK's, and stumbled upon this almost by accident. This seems to work, but requires the entire 'sub' object from the get-vmguestdisk command be passed to the get-harddisk -vmguestdisk command. Does anyone know if there is a particular property of the get-vmguestdisk that makes this work? I'm just trying to make human logical sense that it really does find the correct harddisk given the guestdisk.

foreach($guestdisk in (get-vmguestdisk -VM MyVMServer)){
$vmdk=get-harddisk -vmguestdisk $guestdisk
$guestdisk.DiskPath+" "+$vmdk.filename
}
0

There are 0 best solutions below