PowerShell is a very powerful tool you can use across Microsoft technologies. Microsoft will keep on adopting and improving this technology every time. Right now PowerShell module ver 2 for HYPER-V has been released. This article will discuss how can you install the modules correctly into your Windows 2008 R2 server. Please note this is for Windows 2008 R2 only!
First get the PS modules from the codeplex web site. Url is here
Download the zip file to a root drive or any preferred area and unzip. Once that complete locate the “install.bat” file and execute it with administrator privilege.
Once the installation completed, we’ll move the unzip folder in the PS module folder located in the root drive, (I’ve rename the folder as HyperV and copied to the modules folder)
Now we can import this to the system by executing through PowerShell. Open the PowerShell and try to run “import-module HyperV” you’ll grant with a error message
We need to enable the execution permissions to import the module, please follow the instruction mention in below screenshot,
After that import the Hyper-V modules,
Now when that complete we can run the command “Get-Command –Module hyperv” to list down the available commands,
Now we have plethora of task can be automated combing these commands, it’s all about your imagination