%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
-ExecutionPolicy ByPass -file "C:\VHD\mountVHD.ps1"
Mount-DiskImage -ImagePath "C:\VHD\DriveD.vhdx"
If you were using Mount-VHD
to mount VHD disks like this:
Mount-VHD –Path "C:\VHD\DriveD.vhdx"
You would be possible to get this error message in future:
Mount-VHD : The Hyper-V Management Tools could not access an expected WMI class on computer 'LESCA-Computer'. This may indicate that the Hyper-V Platform is not installed on the computer or that the version of the Hyper-V Platform is incompatible with these management tools.
Reason:
Mount-VHD
requires Hyper-V role installed
Mount-DiskImage -ImagePath "C:\VHD\DriveD.vhdx" # In case you enabled BitLocker $SecureString = ConvertTo-SecureString "Password" -AsPlainText -Force Unlock-BitLocker -MountPoint "D:" -Password $SecureString