PowerShell Scripts, Tips, Expert Advices, Forums, and Resources

image rotation

Welcome to PowerShell.com, the educational and community site for Windows PowerShell People. Get a quick overview.

Latest Forum Posts

11-24-2014 - Security Log
11-24-2014 - powershell only showing last line output
11-24-2014 - Hide/Show Form Buttons Based on Selection

Latest Scripts

11-20-2014 - Are my servers online?
11-11-2014 - scope
11-06-2014 - uptime via kernel

Latest Announcements/Events

10-31-2014 - Using PowerShell to download Teched Europe 2014 content
10-15-2014 - Class Dismissed
10-12-2014 - The Case for PowerShell

As a Powershell.com member you will have access to:

  • Daily PowerShell tips written by Microsoft MVPs and other leading Windows PowerShell experts
  • Free Windows PowerShell advice and training provided by Microsoft MVPs and other leading Windows PowerShell experts
  • Access to leading Windows PowerShell blogs
  • A free ebook, Mastering PowerShell, written by Microsoft MVP Dr. Tobias Weltner
PowerTip of the Day

Using Cmdlets to Manage Virtual Hard Drives

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!

Copyright 2012 PowerShell.com. All rights reserved.