~fhusson

How to install Microsoft Hyper V in Powershell

Install

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V

Then with the powershell module Hyper-V you can script the creation of a VM.

Import-module Hyper-v

New-VM -Name "My VM Name"  -newVHDPath c:\VM\MyVMName.vhdx -NewVHDSizeBytes 100gb -MemoryStartupBytes 4096mb

More information on :

Uninstall

Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
Discuss on Twitter