I have an issue with PowerShell and the Mount-DiskImage cmdlet-it doesn’t auto assign a drive letter when it mounts a VHD. If I use
$Disk=Mount-DiskImage -ImagePath $VHD -PassThru
It will mount the VHD file but it will not assign a drive letter, nor does seem to even be attached.
Attached : False
BlockSize : 2097152
FileSize : 55220109312
ImagePath : Path to VHD
LogicalSectorSize : 512
Size : 137067757568
StorageType : 3
Any help would be appreciated.
Thanks in advance
What OS are you using? Do you see your VHD mounted in Explorer? When I tested this with Windows 10 1703, I get the same output in the console (Attached = False), but when I check Explorer, I see the mounted VHD with a drive letter.
yes I am running 17.03 as well. I see it in Disk Management mounted but there is no drive letter assigned to it. I can assign a drive letter to it from DiskPart and from Disk Management but not from PowerShell as it it doesn’t even return a ID for the disk number so I can’t pipe it to the Get-Disk cmdlet
If you open Diskpart as an administrator and type automount it will give the current policy. Setting this to enable i.e. automount enable should give any new VHD’s a drive letter
I checked on the automount setting with DiskPart and it is set to enabled already.
I have bypassed Mount-DiskImage and enabled Hyper-V Services so I can use Mount-VHD.
The Mount-VHD command works as expected, I assume the Mount-DiskImage just does not work as I would expect it to.