Mount VHD and get drive letter


I am looking to get the drive letter of the VHD mount using Powershell. I can mount the VHD with the below cmdlet:

The mount works fine, but when I try getting the drive letter:

It fails with below error:

Get-DiskImage : Invalid property

I believe Get-DiskImage works fine for an ISO, but not for VHD? Can you help me in obtaining it for VHD.


This way work for me:

Then Write-Output $DriveLetter will show the drive letter.


Mount VHD and get drive letter by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply