Fixed an error with removing the office variable when capturing the FFU

This commit is contained in:
rbalsleyMSFT
2024-12-02 18:34:58 -08:00
parent db0fbfaaf4
commit 6abc6f9d1a
@@ -88,11 +88,13 @@ if ($CustomFFUNameTemplate) {
#Unload Registry
Set-Location X:\
Remove-Variable SKU
Remove-Variable CurrentBuild
if ($CurrentBuild -notin 14393, 17763) {
Remove-Variable WindowsVersion
}
Remove-Variable CurrentBuild
Remove-Variable Office
if($Office) {
Remove-Variable Office
}
reg unload "HKLM\FFU"
#This prevents Critical Process Died errors you can have during deployment of the FFU - may not happen during capture from WinPE, but adding here to be consistent with VHDX capture
Write-Host "Sleeping for 60 seconds to allow registry to unload prior to capture"