Creating virtual machines

You are all set, and it's time to create some virtual machines. To do a rapid deployment of virtual machines, we will rely on PowerShell.

Creating a new virtual machine with PowerShell is easy; just open an elevated PowerShell prompt, and run the following command:

New-VM

Without any additional parameters, this will create a new virtual machine with the default parameters. To create a new Generation 2 VM, run the following command:

New-VM -Generation 2

To create a new virtual machine with a specified name, a custom path to store the VM files, and a memory configuration, run the following command:

New-VM -Name VM01 -Path C:\VM01 -Memorystartupbytes 1024MB

Your newly created virtual machine doesn't have a hard disk yet. ...

Get Hyper-V 2016 Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.