This topic contains 4 replies, has 3 voices, and was last updated by
July 18, 2017 at 9:36 pm #75208
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
July 18, 2017 at 10:31 pm #75212ParticipantTopics: 0Replies: 44Points: 43Rank: Member
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.
July 19, 2017 at 5:51 am #75218
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
July 19, 2017 at 8:37 am #75223ParticipantTopics: 18Replies: 244Points: 109Rank: Participant
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
July 20, 2017 at 6:40 am #75298
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.
The topic ‘Mount-DiskImage Not assigining Drive letter’ is closed to new replies.