Add Taskbaritem indication

This commit is contained in:
MyDrift
2025-03-07 15:23:29 +01:00
parent a9675fc91b
commit 8fabebedf4
3 changed files with 12 additions and 1 deletions

View File

@ -2,6 +2,7 @@ function Invoke-WPFUpdatesScan {
Invoke-WPFRunspace -DebugPreference $DebugPreference -ScriptBlock {
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
# Check if the PSWindowsUpdate module is installed
if (-not (Get-Module -ListAvailable -Name PSWindowsUpdate)) {
try {
@ -51,8 +52,10 @@ function Invoke-WPFUpdatesScan {
$sync["WPFUpdatesList"].Columns[0].Visibility = "Collapsed"
}
})
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
} catch {
Write-Error "Error scanning for updates: $_"
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -overlay "warning" })
}
}
}