我想将一些VHDX文件转换为VHD,这样我就可以将它们上传到Microsoft Azure,因为我必须为一家公司将一些服务器迁移到云。问题是,我的服务器似乎不知道PowerShell中的VHD命令。
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
和
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
有人知道怎么解决这个问题吗?Hyper-V无法安装,VirtualBox也无法安装。服务器本身是Azure上托管的Windows 10 Technical Preview 3虚拟机。Powershell的版本为5.0.10514.0。
您也可以使用Virtualbox进行尝试。首先打开Powershell并转到安装文件夹。
cd";C: \Program Files\Oracle\VirtualBox"
然后尝试
\VBoxManage.exe convertfromraw";C: \Users\username\your\path\file.VVHDX"C: \Users\username\your\path\file.VHD"--格式化VHD
您的系统上安装的powershell版本是什么?仅在PS V4上支持Convert VHD cmdlet。否则,如果由于某种原因没有安装hyper-V的PS模块,您可以从以下链接下载并导入hyper-V的模块:http://pshyperv.codeplex.com/
更新:
你需要启用hyper-v第一
cmd供您参考:
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart