Skip to content

Commit

Permalink
Create Export-WindowsServer2019WIMfromISO.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
arwidmark committed May 26, 2021
1 parent 5457e97 commit 91d3bfb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Scripts/Export-WindowsServer2019WIMfromISO.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Script to extract the Windows Server 2019 Standard index from a Windows Server 2019 media.
# Update line 4 and 5 to match your environment

$ISO = "E:\iso\Windows Server 2019 (updated May 2021).iso" # Path to Windows Server 2019 media
$WIMFolder = "C:\WIM" # Target folder for extracted WIM file containg Windows Server 2019 Standard only
$WIMFile = "$WIMFolder\REFWS2019-001.wim"
$Edition = "Windows Server 2019 Standard (Desktop Experience)"

Mount-DiskImage -ImagePath $ISO | Out-Null
$ISOImage = Get-DiskImage -ImagePath $ISO | Get-Volume
$ISODrive = [string]$ISOImage.DriveLetter+":"
If (!(Test-path $WIMPath)){ New-Item -Path $WIMPath -ItemType Directory -Force | Out-Null } # Create folder if needed
Export-WindowsImage -SourceImagePath "$ISODrive\sources\install.wim" -SourceName $Edition -DestinationImagePath $WIMFile
Dismount-DiskImage -ImagePath $ISO | Out-Null

0 comments on commit 91d3bfb

Please sign in to comment.