diff --git a/.pipelines/templates/.build-and-test-windows-vhds-template.yaml b/.pipelines/templates/.build-and-test-windows-vhds-template.yaml index d6dcdaf7ecc..94cbc24a775 100644 --- a/.pipelines/templates/.build-and-test-windows-vhds-template.yaml +++ b/.pipelines/templates/.build-and-test-windows-vhds-template.yaml @@ -132,6 +132,6 @@ stages: -e SIG_GALLERY_NAME=${SIG_GALLERY_NAME} \ -e OS_TYPE="Windows" \ ${AZURE_CONTAINER_IMAGE} make -f packer.mk backfill-cleanup - enabled: false + enabled: true displayName: Backfill Clean Up Older Resources condition: eq(variables.ENABLE_BACKFILL_CLEANUP, 'True') diff --git a/vhdbuilder/packer/windows/configure-windows-vhd.ps1 b/vhdbuilder/packer/windows/configure-windows-vhd.ps1 index 3ab87ad779d..662dd2527d2 100644 --- a/vhdbuilder/packer/windows/configure-windows-vhd.ps1 +++ b/vhdbuilder/packer/windows/configure-windows-vhd.ps1 @@ -332,6 +332,25 @@ function Get-FilesToCacheOnVHD Download-File -URL $URL -Dest $dest } } + + + foreach ($dir in $map.Keys) + { + LogFilesInDirectory "$dir" + } +} + +function LogFilesInDirectory +{ + Param( + [string] + $Directory + ) + + Get-ChildItem -Path "$Directory" | ForEach-Object { + $sizeKB = [math]::Round($_.Length / 1KB, 2) + Write-Output "$( $_.Name ) - $sizeKB KB" + } } function Get-ToolsToVHD @@ -345,6 +364,8 @@ function Get-ToolsToVHD Download-File -URL "https://download.sysinternals.com/files/DU.zip" -Dest "$global:aksToolsDir\DU.zip" Expand-Archive -Path "$global:aksToolsDir\DU.zip" -DestinationPath "$global:aksToolsDir\DU" -Force Remove-Item -Path "$global:aksToolsDir\DU.zip" -Force + + LogFilesInDirectory "$global:aksToolsDir\DU" } function Register-ExpandVolumeTask