Skip to content

Instantly share code, notes, and snippets.

@jdrzejb
Created January 19, 2021 22:54
Show Gist options
  • Save jdrzejb/bbc017705ad7b6f6af46f0bad6cf671a to your computer and use it in GitHub Desktop.
Save jdrzejb/bbc017705ad7b6f6af46f0bad6cf671a to your computer and use it in GitHub Desktop.
Bootable Windows Server Iso
$ISOFile = "C:\Users\DELL\Downloads\17763.737.190906-2324.rs5_release_svc_refresh_SERVERHYPERCORE_OEM_x64FRE_en-us_1.iso"
$USBDrive = Get-Disk | Where FriendlyName -eq " USB Flash Memory"
$USBDrive | Clear-Disk -RemoveData -Confirm:$true -PassThru
$USBDrive | Set-Disk -PartitionStyle GPT
$Volume = $USBDrive | New-Partition -UseMaximumSize -AssignDriveLetter | Format-Volume -FileSystem FAT32 -NewFileSystemLabel WS2019
$ISOMounted = Mount-DiskImage -ImagePath $ISOFile -StorageType ISO -PassThru
$ISODriveLetter = ($ISOMounted | Get-Volume).DriveLetter
Copy-Item -Path ($ISODriveLetter +":\*") -Destination ($Volume.DriveLetter + ":\") -Recurse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment