forked from DeploymentResearch/DRFiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Export-WindowsServer2019WIMfromISO.ps1
- Loading branch information
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 |