'Convert VHDX to VHD (Get-VHD and Convert-VHD are not recognized)
I wanted to convert some VHDX files to VHDs so that I can upload them to Microsoft Azure as I have to migrate some Servers to the Cloud for a company. The problem is, that my Server seems to not know the VHD commands in the PowerShell.
Get-VHD : The term 'Get-VHD' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Get-VHD -Path * | %{Convert-VHD -Path $_.Path -DestinationPath ($_.Pa ...
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-VHD:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
and
Convert-VHD -Path ".\VHDName.vhdx" -DestinationPath ".\VHDName.vhd"
Convert-VHD : The term 'Convert-VHD' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Convert-VHD -Path ".\Windows 8.1 x86 Update1 UpdatePack Upgrade.vhdx" ...
+ ~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Convert-VHD:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Has anyone got an idea how to fix that? Hyper-V can't be installed, VirtualBox neither. The Server itself is a Windows 10 Technical Preview 3 VM hosted on Azure. The Version of Powershell is 5.0.10514.0.
Solution 1:[1]
You could also try it with Virtualbox. First open a Powershell and go to the installation folder.
cd "C:\Program Files\Oracle\VirtualBox"
Then try
.\VBoxManage.exe convertfromraw "C:\Users\username\your\path\file.VHDX" "C:\Users\username\your\path\file.VHD" --format VHD
Solution 2:[2]
What is the version of powershell installed on your system? Convert-VHD cmdlet is supported only on PS V4. Otherwise if for some reason your PS module for hyper-V is not installed, you can download and import the module for Hyper-V from this link: http://pshyperv.codeplex.com/
Updates:
you need enable hyper-v first
cmd for your reference:
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | bjoern.stark |
| Solution 2 | BMW |
