Hyper-V: Creating Virtual Machines With PowerShell

As I wrote in my previous article, managing Hyper-V from PowerShell is quite easy. You can:

  • create,
  • configure,
  • and manage your virtual machines with few command lines.

First thing, you need to install the Hyper-V PowerShell module.

Now, you can run the New-VM PowerShell cmdlet as below:

Let’s check if the VM is created with GUI:

2016-07-09 16_47_02-Hyper-V Manager

or with PowerShell:

Now, we will check the network settings (SwitchName is LAN):

Check the VHDX path (C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Hard Disks\VMTestNicolas.VHDX):

Check the Startup Memory (1GB):

Check the VM Generation (VM Gen 2):

 

 

Thanks for reading! You can follow me on Twitter @PrigentNico

About Nicolas 268 Articles
I work as an IT Production Manager, based in Paris (France) with a primary focus on Microsoft technologies. I have 10 years experience in administering Windows Servers. . I am a Microsoft MVP for Cloud & Datacenter Management. I also received the PowerShell Hero 2016 award by PowerShell.0rg. And finally, I am "MCSE: Cloud Platform and Infrastructure", "MCSA: Windows Servers", "Administering & Deploying SCCM", and CheckPoint CCSA certified.