mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[Windows] Add Windows 2025 code (#11037)
This commit is contained in:
@@ -49,3 +49,24 @@ cmd /c "npm cache clean --force 2>&1" | Out-Null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Failed to clean npm cache"
|
||||
}
|
||||
|
||||
if (Test-IsWin25) {
|
||||
$directoriesToCompact = @(
|
||||
'C:\Windows\assembly',
|
||||
'C:\Windows\WinSxS'
|
||||
)
|
||||
Write-Host "Starting Image slimming process"
|
||||
$start = get-date
|
||||
$ErrorActionPreviousValue = $ErrorActionPreference
|
||||
$ErrorActionPreference = 'SilentlyContinue'
|
||||
Write-Host "Removing 'C:\Windows\Installer' directory"
|
||||
Remove-Item "$env:windir\Installer" -Recurse -Force | Out-Null
|
||||
foreach ($directory in $directoriesToCompact) {
|
||||
Write-Host "Compressing '$directory' directory"
|
||||
& compact /s:"$directory" /c /a /i /EXE:LZX * | Out-Null
|
||||
}
|
||||
$ErrorActionPreference = $ErrorActionPreviousValue
|
||||
$finish = get-date
|
||||
$time = "$(($finish - $start).Minutes):$(($finish - $start).Seconds)"
|
||||
Write-Host "The process took a total of $time (in minutes:seconds)"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user