takondo / WinREupdate

Sample script to patch WinRE
MIT License
10 stars 1 forks source link

WinREupdate

This is a sample PowerShell script developed by the Microsoft product team to help automate the patching of WinRE images on Windows 10 and Windows 11 machines. Run the script with Administrator privileges on affected platforms. There are 2 scripts based on the version of Windows you are running. Please use the appropriate version for your environment.

This script will:

  1. Mount the existing WinRE image
  2. Updates the WinRE image with the specified package
  3. Unmount the WinRE image
  4. If the BitLocker TPM protector is present, reconfigures WinRE for BitLocker service

Usage

There are 2 parameters that can be passed to the script

workDir              Specifies the scratch space used to patch WinRE. Optional (defaults to system TEMP folder).
packagePath      Specifies the package to be used to update the WinRE. Required. Can be a local path or a remote UNC path.

Example:

.\PatchWinREScript_2004plus.ps1 -packagePath "\\server\share\windows10.0-kb5021043-x64_efa19d2d431c5e782a59daaf2d04d026bb8c8e76.cab"