
If you need to setup a few Hyper VM – then Powershell is the quickest and easisest way to do it. The only thing you need to change are the #Variables.
After this open Windows Powershell ISE and execute the Code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
##################################################################### ## (C) 2016 Adrian Reinhard (reinhard.be) #################################################################### # Variables $CLI1 = "SRV2016" # Hostname $RAM = 4GB # RAM assigned to Client Operating System $CLI1HDD = 18GB # Harddisk Size $VMDir = "C:\HYPERV\VHDX" # VM Location $NetworkSwitch = "vmswitch" # Name of the Network Switch $COMPUTERNAME = "SRVHYP" # Name of the Hyper-V Host $Cpu=2 # Number of vCPUs # Create Virtual Machines New-VM -Name $CLI1 -Path $VMDir -MemoryStartupBytes $RAM -NewVHDPath $VMDir\$CLI1.vhdx -NewVHDSizeBytes $CLI1HDD -Generation 2 -ComputerName $COMPUTERNAME -SwitchName $NetworkSwitch SET-VMProcessor –VMName $CLI1 –count $Cpu |