diff --git a/images/windows/scripts/build/Invoke-Cleanup.ps1 b/images/windows/scripts/build/Invoke-Cleanup.ps1 index 56a9ce433fc2..f9bc431b17ba 100644 --- a/images/windows/scripts/build/Invoke-Cleanup.ps1 +++ b/images/windows/scripts/build/Invoke-Cleanup.ps1 @@ -15,7 +15,7 @@ Write-Host "Clean up various directories" "$env:SystemRoot\logs", "$env:SystemRoot\winsxs\manifestcache", "$env:SystemRoot\Temp", - "$env:SystemRoot\Installer\*", + $(if(Test-IsWin25){"$env:SystemRoot\Installer\*"}), "$env:SystemDrive\Users\$env:INSTALL_USER\AppData\Local\Temp", "$env:TEMP", "$env:AZURE_CONFIG_DIR\logs",