Create the VM with its disk, attach the Windows Server ISO and set it to boot from the ISO.
Hyper-V host
$vm = "CON-DC-01" $root = "D:\VMs" $iso = "D:\ISOs\WindowsServer2025.iso" New-VM -Name $vm -Generation 2 -Path $root ` -MemoryStartupBytes 4GB ` -NewVHDPath "$root\$vm\$vm.vhdx" -NewVHDSizeBytes 60GB ` -SwitchName "CON-LAN" Set-VMProcessor -VMName $vm -Count 2 Add-VMDvdDrive -VMName $vm -Path $iso Set-VMFirmware -VMName $vm -FirstBootDevice (Get-VMDvdDrive -VMName $vm)
| Setting | Why |
|---|---|
| Generation 2 | Needed for Secure Boot and UEFI. You cannot change the generation later. |
| NewVHDSizeBytes | The disk grows as it fills, up to this size. |
| FirstBootDevice | Starts from the ISO the first time. |
Done when
Check
Get-VM CON-DC-01 shows the VM as Off, with Generation 2.


