virtualboy blog

Matt McSpirit on Virtualisation, Management and Core Infrastructure

PowerShell and Hyper-V

PowerShell and Hyper-V

  • Comments 2
  • Likes

PowerShellLogo

I’m seeing more and more blog posts out there on the web, that talk about the use of PowerShell to perform certain tasks and actions.  For those of you not familiar, from Wikipedia:

Windows PowerShell is an extensible command-line shell and associated scripting language from Microsoft. It was released in 2006 and is currently available for Windows XP SP2/SP3, Windows Server 2003, Windows Vista and is included in Windows Server 2008 as an optional feature.

So, it’s actually called Windows PowerShell?  So that means I can only use it to do stuff to Windows?  Nope.  In the Virtualisation space alone, VMware are using it, (in fact, they even ran a contest on it!) Citrix are using it, and as you can expect, Microsoft’s Hyper-V can be manipulated by PowerShell.

Why would you want to use PowerShell.  Well, I’m not a PowerShell expert, but like any script, for me, it’s about repeatable actions.  If I want to create a virtual machine in Hyper-V, I know that I can quickly go through a wizard to create that VM to my satisfaction, but what if I want to create 100 VMs, or 1000, overnight, ready for when I come in in the morning?  How do I do that with a wizard?  God knows!  However, I know that I can write one script in PowerShell, utilise a couple of variables here and there, and bang, run script and create the VMs I need.  Anyone who saw me speak at the SQL 2008 Launch back in October, where we also discussed Hyper-V, would have seen me create a load of VMs on a remote Hyper-V Server box, using PowerShell.

Where do you get started with PowerShell and Hyper-V?  Good question!  There are loads of entry points into learning about PowerShell.  It may be good to get some grounding with the PowerShell Owners Manual!!  That should get you over the basics, but what about the Hyper-V specific commands for PowerShell?  Well, James O’Neill has written a fair few posts about PowerShell on his blog, and he’s even provided a good sized library of PowerShell Hyper-V stuff on CodePlex, so why not reuse his work and save yourself some time!

So, I’ve given you the basics, the Hyper-V specific stuff, but what if, like me, you still prefer a GUI?

Well, the guys over at PowerGui.org have built a GUI for PowerShell – isn’t that handy!  By default, PowerGui allows administration of Windows, however with the PowerGui PowerPacks, you can effectively bring in more and more capability into the GUI, all for free!  Windows IT Pro magazine recently featured an article on the top 10 features of PowerGui too!

The most recent PowerPack addition to the family, is the Hyper-V PowerPack, which brings in the ability to manage Hyper-V using PowerGui.

Download PowerGui now and get scripting!

Comments
Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment