Hyper-V Module for Windows PowerShell
Updated: December 4, 2014
Applies To: Windows 8.1, Windows Server 2012 R2, Windows Server 2012, Windows 8
The Hyper-V module for Windows PowerShell includes more than 160 Hyper-V cmdlets. These cmdlets provide an easy way to automate Hyper-V management tasks.
For an alphabetical list of all Hyper-V cmdlets Windows Server 2012, as well as links to reference content for each cmdlet (including examples), see Hyper-V Cmdlets in Windows PowerShell.
The Hyper-V module supports the Update-Help cmdlet, which allows you to download the newest help files for Windows PowerShell modules and install the files on your computer. Your account must be a member of the Administrators group on the computer you want to update. To update Help for the Hyper-V module, start Windows PowerShell with the "Run as administrator" option (Start-Process PowerShell -Verb RunAs) and run the following command: PS C:\> Update-Help –Module Hyper-V
The new Hyper-V cmdlets for Windows PowerShell provide IT pros with an easy way to enable automation of management tasks. With the extensive number of Hyper-V cmdlets and the close integration with other parts of the operating system, administrators can now easily enable automation of Hyper-V-related tasks in their environment.
Hyper-V cmdlets are designed so that it is easy for IT pros to go from thinking about the task to actually performing the task. The following table shows the task and the associated cmdlet syntax:
Windows PowerShell command to perform the task
Create a new virtual machine named “test”
New-VM –Name Test
Get a list of all virtual machines
Create a new virtual hard disk at d:\VHDs\test.vhd
New-VHD –Path D:\VHDs\test.vhd
Start all virtual machines whose name begins with “web”
Start-VM –Name web*
Connect the virtual network adapter on the “test” virtual machine to the “QA” switch.
Connect-VMNetworkAdapter –VMName test –SwitchName QA
Hyper-V administrators often need to manage more than just Hyper-V. By using the same verbs as other Windows cmdlets, the Hyper-V cmdlets make easier for administrators to extend their existing knowledge of Windows PowerShell. For example, administrators who are familiar with managing services through Windows PowerShell can reuse the same verbs to perform the corresponding tasks on a virtual machine, as shown in the following table:
Cmdlet for performing task on a service
Cmdlet for performing task on a virtual machine
There are similar examples with other core Windows PowerShell cmdlets as well:
Core Windows PowerShell cmdlet
The nouns of the Hyper-V cmdlets are designed to make it easier for administrators to discover the cmdlets they need when they need them. All cmdlets in the Hyper-V module use one of three following noun prefixes:
Cmdlets for managing virtual machines
Cmdlets for managing virtual hard disk files
Cmdlets for managing virtual floppy disk files