azure 将VHDX转换为VHD(无法识别Get-VHD和Convert-VHD)

gk7wooem  于 2022-12-14  发布在  其他
关注(0)|答案(2)|浏览(123)

我想将一些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。

20jt8wwn

20jt8wwn1#

你也可以用VirtualBox试试。首先打开一个Powershell,转到安装文件夹。
CD“C:\程序文件\Oracle\虚拟机”
那就试试
.\VBoxManage.exe从原始“C:\用户\用户名\您的\路径\文件.VHDX”“C:\用户\用户名\您的\路径\文件.VHD”--格式VHD

zy1mlcev

zy1mlcev2#

您的系统上安装的powershell版本是什么?Convert-VHD cmdlet仅在PS V4上受支持。否则,如果由于某种原因未安装Hyper-V的PS模块,您可以通过以下链接下载并导入Hyper-V的模块:http://pshyperv.codeplex.com/
更新内容:
您需要先启用hyper-v
cmd供您参考:

Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart

相关问题