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 #Unload Registry
Set-Location X:\ Set-Location X:\
Remove-Variable SKU Remove-Variable SKU
Remove-Variable CurrentBuild
if ($CurrentBuild -notin 14393, 17763) { if ($CurrentBuild -notin 14393, 17763) {
Remove-Variable WindowsVersion Remove-Variable WindowsVersion
} }
Remove-Variable CurrentBuild if($Office) {
Remove-Variable Office Remove-Variable Office
}
reg unload "HKLM\FFU" 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 #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" Write-Host "Sleeping for 60 seconds to allow registry to unload prior to capture"