Using the Virtual Machine Manager Command Shell
Virtual Machine Manager provides the Windows PowerShell - Virtual Machine Manager command shell that you can use as an alternative to (or in addition to) using the Virtual Machine Manager Administrator Console for centralized management of your physical and virtual system infrastructure. You can use this command shell to perform all administrative functions in Virtual Machine Manager from the command line, such as adding virtual machine hosts to your Virtual Machine Manager environment, adding resources to the library, or creating virtual machines. You can also create Windows PowerShell scripts to perform these tasks or a series of related tasks.
The Virtual Machine Manager command shell is built on Microsoft Windows PowerShell, an administrator-focused command-line shell and scripting language that is integrated into the Windows platform. Windows PowerShell and Virtual Machine Manager each provide commands (called cmdlets) that you can use alone to perform simple tasks or in combination with other cmdlets to perform complex tasks. The Virtual Machine Manager implementation of the command shell includes all core Windows PowerShell cmdlets and also provides a comprehensive set of cmdlets that are designed specifically for use in Virtual Machine Manager.
You can use the following resources to learn more about the Virtual Machine Manager command shell and to learn how to use Virtual Machine Manager cmdlets:
- Conceptual help topics. After you install the Virtual Machine Manager service on a Virtual Machine Manager server, you can open the Virtual Machine Manager command shell from the same menu that you use to open the Administrator Console. At the command shell prompt, you can type the following commands to display conceptual help topics about the Virtual Machine Manager command shell:
- Help topics and examples for each cmdlet. At the Virtual Machine Manager command shell prompt, you can use the following commands to display a list of Virtual Machine Manager cmdlets and to display a detailed help topic—including examples—for each cmdlet:
List all cmdlets. To display all Virtual Machine Manager cmdlets, open the command shell and then type the following:
Get-Command -PSSnapin Microsoft.SystemCenter.VirtualMachineManager
(If you want to display a complete list of all snap-ins included in Windows PowerShell, type
View help for one cmdlet. To display the help topic for a specific Virtual Machine Manager cmdlet, open the command shell and then type the following:
Get-Help <Cmdlet-Name> -detailed
- Administrator Console wizard scripts. A View Script button on the final page of each wizard in the Administrator Console allows you to view and copy the Windows PowerShell cmdlets for your current operation.
To learn more about the Virtual Machine Manager command shell, see the Virtual Machine Manager Scripting Guide at http://go.microsoft.com/fwlink?LinkID=99091.