question

SagarJadhav-0528 avatar image
0 Votes"
SagarJadhav-0528 asked IanXue-MSFT answered

Mount-VHD - no drive letter getting assigned when vhdx file mounted using mount-vhd command

the driver letter column is empty, this command works perfectly on ws2019.
the problem is only with ws2022

PS C:\> Mount-VHD C:\10.0.20348.350.vhdx -Passthru | Get-Disk | Get-Partition | Get-Volume

DriveLetter FriendlyName FileSystemType DriveType HealthStatus OperationalStatus SizeRemaining Size


         10.0.20348.1 NTFS           Fixed     Healthy      OK                    100.86 GB 126.4 GB
                      NTFS           Fixed     Healthy      OK                     85.41 MB   494 MB
                      FAT32          Fixed     Healthy      OK                     67.26 MB    96 MB
windows-server-hyper-v
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

IanXue-MSFT avatar image
0 Votes"
IanXue-MSFT answered

Hi,

The Mount-VHD cmdlet is part of the Hyper-V module. Please check the module versions on your servers using Get-Command Mount-VHD and see if they are the same.

Or you can use Set-CimInstance to set the drive letter. For more details please refer to this link
https://devblogs.microsoft.com/powershell-community/changing-drive-letters-and-labels-via-powershell/

Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.