Skip to content

Instantly share code, notes, and snippets.

@Anduin2017
Last active October 13, 2021 08:37
Show Gist options
  • Save Anduin2017/d56eec2b390537be70ce39d2b43d8489 to your computer and use it in GitHub Desktop.
Save Anduin2017/d56eec2b390537be70ce39d2b43d8489 to your computer and use it in GitHub Desktop.
powerful pe
New-Item -Path "C:\Temp" -Type Directory
Dism /Mount-Image /ImageFile:"E:\sources\boot.wim" /Index:2 /MountDir:"C:\Temp"
$cabs = Get-ChildItem "*.cab" -Path "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs"
foreach($cab in $cabs) {
Dism /Add-Package /Image:"C:\Temp" /PackagePath:"$($cab.VersionInfo.FileName)"
}
$cabs = Get-ChildItem "*.cab" -Path "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us"
foreach($cab in $cabs) {
Dism /Add-Package /Image:"C:\Temp" /PackagePath:"$($cab.VersionInfo.FileName)"
}
Dism /Unmount-Image /MountDir:"C:\Temp" /Commit
Remove-Item -Path "C:\Temp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment