Centralizes KB path cleanup into common cleanup module

Removes duplicated KB path cleanup logic scattered across multiple locations in the build script and consolidates it into the shared cleanup module.

Adds KBPath parameter to the cleanup function and handles removal of Windows/.NET cumulative update downloads when RemoveUpdates flag is set.

Improves maintainability by eliminating redundant cleanup code and ensures consistent cleanup behavior across different build scenarios including standard builds, VHDX caching, and restore defaults operations.
This commit is contained in:
rbalsleyMSFT
2025-12-16 21:18:42 -08:00
parent c6088d91fa
commit 9737d5c930
3 changed files with 20 additions and 32 deletions
@@ -870,6 +870,7 @@ function Invoke-RestoreDefaults {
-CaptureISOPath $captureISOPath `
-DeployISOPath $deployISOPath `
-AppsISOPath $appsISOPath `
-KBPath (Join-Path $rootPath 'KB') `
-RemoveCaptureISO:$true `
-RemoveDeployISO:$true `
-RemoveAppsISO:$true `