Skip to content

Instantly share code, notes, and snippets.

@turboBasic
Last active October 14, 2017 15:38
Show Gist options
  • Save turboBasic/8bd2999201e89bce2c67a16615f73946 to your computer and use it in GitHub Desktop.
Save turboBasic/8bd2999201e89bce2c67a16615f73946 to your computer and use it in GitHub Desktop.
[Create Gen.2 Hyper-V Virtual Machine]
New-VM -name WADK -memoryStartupBytes 750MB -generation 2 -newVHDPath b:\VMs\wadk.vhdx -newVHDSizeBytes 25GB -bootDevice VHD
Add-VMDvdDrive WADK
Start-Sleep -seconds 5
$ws2016ISO = "D:\ISOs\Windows Server 2016\Microsoft Windows Server 2016 Version 1607 Build 10.0.14393.447 Updated Jan 2017 VLSC\SW_DVD9_Win_Svr_STD_Core_and_DataCtr_Core_2016_64Bit_English_-3_MLF_X21-30350.ISO"
Set-VMDvdDrive -VMName WADK -path $ws2016ISO -toControllerNumber 0 -toControllerLocation 1
Start-Sleep -Seconds 5
$dvd = Get-VMDvdDrive -VMName WADK
Set-VMFirmware -VMName WADK -firstBootDevice $dvd
Start-Sleep -Seconds 5
Start-VM WADK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment