Differences

This shows you the differences between two versions of the page.

Link to this comparison view

usb_windows_installer [2020/07/14 13:25] (current)
john created
Line 1: Line 1:
 +====== Make a Windows USB Installer in Powershell ====== 
 +<code> 
 +# Define Path to the Windows Server 2019 ISO 
 +$ISOFile = "C:\en_windows_server_2019_x64.iso" 
 +  
 +# Get the USB Drive you want to use, copy the friendly name 
 +Get-Disk | Where BusType -eq "USB" 
 +  
 +# Get the right USB Drive (You will need to change the FriendlyName) 
 +$USBDrive = Get-Disk | Where FriendlyName -eq "SanDisk Cruzer Glide 3.0" 
 +  
 +# Replace the Friendly Name to clean the USB Drive (THIS WILL REMOVE EVERYTHING) 
 +$USBDrive | Clear-Disk -RemoveData -Confirm:$true -PassThru 
 +  
 +# Convert Disk to GPT 
 +$USBDrive | Set-Disk -PartitionStyle GPT 
 +  
 +# Create partition primary and format to FAT32 
 +$Volume = $USBDrive | New-Partition -UseMaximumSize -AssignDriveLetter | Format-Volume -FileSystem FAT32 -NewFileSystemLabel WS2019 
 +  
 +# Mount iso 
 +$ISOMounted = Mount-DiskImage -ImagePath $ISOFile -StorageType ISO -PassThru 
 +  
 +# Driver letter 
 +$ISODriveLetter = ($ISOMounted | Get-Volume).DriveLetter 
 +  
 +# Copy Files to USB  
 +Copy-Item -Path ($ISODriveLetter +":\*") -Destination ($Volume.DriveLetter + ":\") -Recurse 
 +  
 +# Dismount ISO 
 +Dismount-DiskImage -ImagePath $ISOFile 
 +</code>
usb_windows_installer.txt · Last modified: 2020/07/14 13:25 by john
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0