1
votes

I tried run get-vm command on windows powershell. It is throwing this exception:

"Error in script : The term 'Get-VM' 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."

but I run same command on system center powershell it's run successful. But i need run on windows powershell. can i run it on windows powershell?

1
Are you running ps 2.0 trying to remote control a hyper-v server? If so you need to download the RSAT tools if I remember correctly and activate the "hyper-v powershell module" windows featureFrode F.

1 Answers

2
votes

Import the VMM snapin. System Center's Powershell shortcut loads it per default. Vanilla Powershell doesn't.

Use Get-PSSnapin -Registered to list all available snap-ins. The one you are looking for is Microsoft.SystemCenter.VirtualMachineManager

Load the snap-in: Add-PSSnapin -Name Microsoft.SystemCenter.VirtualMachineManager

Get and set default VMM Server: get-vmmserver myVMMServer.VMMServeror use-VMMServer` switch to specify the VMM server the cmdlet is going to interact with.