Andrew Pruski shows us how to enable Hyper-V and create a Windows VM using Powershell:
I’m constantly spinning up VMs and then blowing them away. Ok, using the Hyper-V GUI isn’t too bad but when I’m creating multiple machines it can be a bit of a pain.
So here’s the details on the script I’ve written, hopefully it could be of some use to you too.
Click through for the script; it’s ultimately just a few lines of code.