Using Cmdlets to Manage Virtual Hard Drives

by Nov 24, 2014

Windows 8.1 Pro/Enterprise or Server 2012 R2

Both Windows 8.1 and Server 2012 R2 come with a vast number of additional cmdlets, some of which can be used to manage virtual disks. However, before you can find and use these cmdlets, you need to activate the “Hyper-V role” (note that Hyper-V support on the client side requires Windows 8.1 Pro or Enterprise. It is not included in the “Home” versions).

In Windows 8.1, you need to do this manually: go to Control Panel, and then to Programs/Programs and Features. You can also enter “appwiz.cpl” in PowerShell to get there.

Next, click “Turn Windows features on or off”. This opens up a dialog with all available features. Identify the node “Hyper-V”, and enable it. Then click OK. If the node “Hyper-V” is missing, then your version of Windows does not support Hyper-V on the client side. If the option “Hyper-V Platform” is grayed out, then you need to enable virtualization support in your computer BIOS settings.

The feature installation takes a couple of seconds. Once it is completed, you have a whole new bunch of cmdlets available:

PS> Get-Command -Module Hyper-V

CommandType     Name                                               ModuleName     
-----------     ----                                               ----------     
Cmdlet          Add-VMDvdDrive                                     Hyper-V        
Cmdlet          Add-VMFibreChannelHba                              Hyper-V        
Cmdlet          Add-VMHardDiskDrive                                Hyper-V        
Cmdlet          Add-VMMigrationNetwork                             Hyper-V        
Cmdlet          Add-VMNetworkAdapter                               Hyper-V         

Twitter This Tip! ReTweet this Tip!