Created
January 19, 2021 22:54
-
-
Save jdrzejb/bbc017705ad7b6f6af46f0bad6cf671a to your computer and use it in GitHub Desktop.
Bootable Windows Server Iso
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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