Fix uninstallation of user-scope apps in WinGet with deferred uninstall

This commit is contained in:
Jeffrey
2026-10-07 23:35:59 +02:00
parent 0fb974c8a0
commit b9924b16ab
8 changed files with 88 additions and 8 deletions
+15
View File
@@ -184,6 +184,21 @@ function Show-ApplyModal {
}
}
}
if ($script:WingetDeferredRemovals -and $script:WingetDeferredRemovals.Count -gt 0) {
foreach ($appId in @($script:WingetDeferredRemovals.Keys | Sort-Object)) {
$tb = [System.Windows.Controls.TextBlock]::new()
$appName = Get-Translation -Key $appId -Field 'FriendlyName' -Section 'Apps'
$label = Get-Translation -Key 'ApplyRebootRequiredWingetDeferred' -FormatArgs @($appName)
$tb.Text = "$([char]0x2022) $label"
$tb.FontSize = 12
$tb.SetResourceReference([System.Windows.Controls.TextBlock]::ForegroundProperty, "AppFgColor")
$tb.Opacity = 0.85
$tb.Margin = [System.Windows.Thickness]::new(0, 2, 0, 0)
$applyRebootList.Children.Add($tb) | Out-Null
}
$applyRebootPanel.Visibility = 'Visible'
}
$applyWindow.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Render, [action]{})
}
catch {