I have a script that starts new HyperV VM's on a remote server using powershell
New-VM
Get-VM
I want to run this script on my desktop, however I get the following error.
the term 'new-vm' is not recognized as the name of a cmdlet
I can't figure out how to install the new-vm cmdlet on my workstation
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
I am very new to powershell, and don't do much with windows.
How can I install the cmdlet New-VM
on a Windows 8 machine?
Update
Also tried the following.
Enable-WindowsOptionalFeature -Online -FeatureName Hyper-V-Tools
Enable-WindowsOptionalFeature -Online -FeatureName Hyper-V-PowerShell
I see hyperv tools in the following command
Get-WindowsOptionalFeature -Online | sort state
Microsoft-Hyper-V
Microsoft-Hyper-V-Tools-All
Microsoft-Hyper-V-Management-Powershell
Update 2
I almost got it installed, but it gives this error:
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>
Got it installed. The powershell cmdlet has parents that can be installed by adding -all
.
Enable-WindowsOptionalFeature -online -FeatureName Microsoft-Hyper-V-Management-Powershell -all
You will need to reboot before the cmdlet is available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With