# Configuration $isoUrl = "https://software.download.prss.microsoft.com/dbazure/Win11_25H2_English_x64_v2.iso?t=160d627b-1c0b-4e2b-8f68-eaf563d3ad23&P1=1787775782&P2=602&P3=2&P4=YZaCYpQB617hSyzmVYZ9zHyOZpoFGkkco8TXLs0dLwxqrR07OWkEPaOXVzOvvTBc1%2f7KOamdYnxnRntpAQ7eNqGIhEsA8haeSiO7ejri3urv%2barDBUY0AlgiOtNyJ6%2fLlgZXVqOmBS9v7uhfOHpv63aMozYAEUVMcVAS1ZWKAQTGMf%2fcXFbABV85TKQHYC5tv4f69rXp%2bxdrthjs2Q6IVQ5KtnR9FD4VLo8t1O%2f23mindRBQdIXnDHJBKieBoTg0UpdWkJiqL0pGmUDPlGR5TG1NGnmKl7XeRY3sCBOLcGXffXCw0Ed41%2b1JP0p4LciHDiDZRJKU41WsHhkF8Cm0DQ%3d%3d" $isoPath = "C:\Win11Temp\Win11.iso" $mountPath = "C:\Win11Temp\Mount" # 1. Setup environment New-Item -ItemType Directory -Path "C:\Win11Temp" -Force New-Item -ItemType Directory -Path $mountPath -Force # 2. Download ISO Write-Host "Downloading ISO..." $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri $isoUrl -OutFile $isoPath # 3. Mount ISO Write-Host "Mounting ISO..." $diskImage = Mount-DiskImage -ImagePath $isoPath -PassThru $driveLetter = ($diskImage | Get-Volume).DriveLetter # 4. Run Setup # Arguments: /auto upgrade (performs in-place), /quiet (no UI), /eula accept $setupPath = "$($driveLetter):\setup.exe" Write-Host "Starting installation..." Start-Process -FilePath $setupPath -ArgumentList "/auto upgrade /quiet /eula accept /product server" -Wait # 5. Cleanup Dismount-DiskImage -ImagePath $isoPath Remove-Item -Path "C:\Win11Temp" -Recurse -Force