Fix the way arguments are passed to the runspace (#2720)

* Fix the way arguments are passed to the runspace

* Add $handle return

* Fix Choco Install logic
This commit is contained in:
Martin Wiethan
2024-09-12 16:45:54 +02:00
committed by GitHub
parent 8e5fcceddb
commit 7fe0f9a163
5 changed files with 28 additions and 12 deletions

View File

@ -20,7 +20,7 @@ function Invoke-WPFInstall {
return
}
$ChocoPreference = $($sync.WPFpreferChocolatey.IsChecked)
Invoke-WPFRunspace -ArgumentList $PackagesToInstall,$ChocoPreference -DebugPreference $DebugPreference -ScriptBlock {
$installHandle = Invoke-WPFRunspace -ParameterList @(("PackagesToInstall", $PackagesToInstall),("ChocoPreference", $ChocoPreference)) -DebugPreference $DebugPreference -ScriptBlock {
param($PackagesToInstall, $ChocoPreference, $DebugPreference)
if ($PackagesToInstall.count -eq 1) {
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })