
Script to update Windows Recovery Environment to patch against CVE-2022-41099
Forked from u/InternetStranger4You with some considerable changes.
Code is split between two modules:
Microsoft.Windows.PSGeneral
Microsoft.Windows.PSMitSec
Microsoft.Windows.PSGeneralAdd-DismPackage, if necessaryOf course, the modules are for demonstration purposes. If you wish to use them properly, you should create manifest files and reference dependencies appropriately.
PSFramework is used instead of the built-in cmdlets.
Add-DismPackage always seems to fail once. The error message itself says it could be a temporary error (such as a race condition to update the Service Stack). Retrying after a few seconds always succeeds.
Test-PSMitSec_CVE202241099Add-DismPackage fails for the first time, it outputs a ton of progress bar text (looks very messy). It should be suppressed.Resize-WinREPartition to accept Winre.wim from alternate source (such as flash drive with install media).