PowerShell scripts to create one or more Hyper-V Virtual Servers

In this post you’ll find a couple of PowerShell scripts that I wrote to create Hyper-V servers with system resources specified when you run the scripts.

The scripts, CreateSingleServer.ps1 is the one to use to create a single server and CreateMultipleServers.ps1 is used to create multiple servers and don’t require any external PowerShell modules apart from the native Hyper-V ones. Simply run the scripts on the host to create the VM’s, entering the parameters when prompted.

I created and tested these on a Hyper-V 2012 host but haven’t had the chance to test it on one of our 2008 R2 hosts as of writing – suffice to say they should work as long as you modify the references to the VHD files from VHDX to VHD in the script.

You can download the zip file containing both scripts by clicking here

If you don’t want to download them, below is the full listing of both scripts, copy them into PowerShell ISE and the formatting should take care of itself