use Dispatcher.Invoke

This commit is contained in:
MyDrift
2024-07-13 12:54:59 +02:00
parent 790e0b22a5
commit 27792dc8a3
10 changed files with 23 additions and 20 deletions

View File

@ -19,7 +19,7 @@ function Install-WinUtilWinget {
Write-Host "`nWinget is not Installed. Continuing with install.`r" -ForegroundColor Red
}
Set-WinUtilTaskbaritem -state "Indeterminate"
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" })
# Gets the computer's information
if ($null -eq $sync.ComputerInfo){
@ -65,6 +65,6 @@ function Install-WinUtilWinget {
throw [WingetFailedInstall]::new('Failed to install!')
}
}
Set-WinUtilTaskbaritem -state "None"
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" })
}