【发布时间】:2015-04-28 21:36:16
【问题描述】:
我有一个使用 powershell 在远程服务器上启动新 HyperV 虚拟机的脚本
New-VM
Get-VM
我想在我的桌面上运行这个脚本,但是我得到了以下错误。
the term 'new-vm' is not recognized as the name of a cmdlet
我不知道如何在我的工作站上安装 new-vm cmdlet
Get-WindowsFeature
the target of the specified cmdlet cannot be a windows client-based operating system
Install-windowsFeature hyperv-
the target of the specified cmdlet cannot be a windows client-based operating system
我对powershell很陌生,对windows做的不多。
如何在 Windows 8 机器上安装 cmdlet New-VM?
更新
还尝试了以下方法。
Enable-WindowsOptionalFeature -Online -FeatureName Hyper-V-Tools
Enable-WindowsOptionalFeature -Online -FeatureName Hyper-V-PowerShell
我在以下命令中看到了 hyperv 工具
Get-WindowsOptionalFeature -Online | sort state
Microsoft-Hyper-V
Microsoft-Hyper-V-Tools-All
Microsoft-Hyper-V-Management-Powershell
更新 2
我几乎安装好了,但它给出了这个错误:
PS C:\Windows\system32> Enable-WindowsOptionalFeature -online -FeatureName Microsoft-Hyper-V-Management-Powershell
Enable-WindowsOptionalFeature : One or several parent features are disabled so current feature can not be enabled.
At line:1 char:1
+ Enable-WindowsOptionalFeature -online -FeatureName Microsoft-Hyper-V-Management- ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Enable-WindowsOptionalFeature], COMException
+ FullyQualifiedErrorId : Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand
PS C:\Windows\system32>
【问题讨论】:
标签: powershell hyper-v