fix: update RunOnce command handling to avoid & enforce length limits (#866)

This commit is contained in:
Jeffrey
2026-10-27 23:08:46 +01:00
committed by GitHub
parent 9f192bd343
commit 08b6ddde9e
5 changed files with 172 additions and 19 deletions
+23 -1
View File
@@ -24,4 +24,26 @@ function Get-RebootFeatureLabels {
}
return $rebootFeatureLabels
}
}
<#
.SYNOPSIS
Resolves one deferred-removal display label per catalog app, grouping its package IDs.
#>
function Get-DeferredAppRemovalLabels {
if (-not $script:WingetDeferredRemovals -or $script:WingetDeferredRemovals.Count -eq 0) { return }
$catalog = Import-JsonFile -filePath $script:AppsListFilePath
$primaryIds = @{}
foreach ($app in $catalog.Apps) {
$ids = @($app.AppId)
foreach ($id in $ids) { $primaryIds[$id] = $ids[0] }
}
$deferredPrimaryIds = foreach ($appId in $script:WingetDeferredRemovals.Keys) {
if ($primaryIds.ContainsKey($appId)) { $primaryIds[$appId] } else { $appId }
}
foreach ($appId in @($deferredPrimaryIds | Sort-Object -Unique)) {
Get-Translation -Key $appId -Field 'FriendlyName' -Section 'Apps'
}
}