Update: This script was updated 2017/11/10 with several new abilities to customize most of what you can define in the Virtual Machine settings.
This is an extremely quick post to help you create Hyper-V virtual machines using PowerShell. The script assumes you've already installed the Hyper-V feature in Windows.
You can define a bunch of variables *highlighted in red below* such as type of Checkpoint, or Memory or CPU settings, to define how your Virtual Machines are created,
The script prompts you for three inputs:
Virtual Machine name
Virtual Switch Name
Generation type (Gen1=legacy, Gen 2=UEFI)
Here's a screenshot of the script in action:
And after running you can see the Virtual Machine properties match what you specified (Gen 2, switch name, cpu settings and so on...)
and the New Virtual Switch is created (if it didn't already exist)
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Introduction
Update: This script was updated 2017/11/10 with several new abilities to customize most of what you can define in the Virtual Machine settings.
This is an extremely quick post to help you create Hyper-V virtual machines using PowerShell. The script assumes you've already installed the Hyper-V feature in Windows.
You can define a bunch of variables *highlighted in red below* such as type of Checkpoint, or Memory or CPU settings, to define how your Virtual Machines are created,
The script prompts you for three inputs:
Here's a screenshot of the script in action:
And after running you can see the Virtual Machine properties match what you specified (Gen 2, switch name, cpu settings and so on...)
and the New Virtual Switch is created (if it didn't already exist)
that's it, have fun.
Downloads
You can download a copy of the script here.
Create HyperV VM2.ps1
Share this post
Link to post
Share on other sites