remove $automation entirely

This commit is contained in:
MyDrift 2024-08-25 21:13:43 +02:00
parent a4d1d0fd67
commit 494ad3c802
3 changed files with 6 additions and 12 deletions

View File

@ -18,14 +18,12 @@ function Invoke-WPFFeatureInstall {
if ($FeatureConfig) { if ($FeatureConfig) {
$Features = $FeatureConfig $Features = $FeatureConfig
$automation = $true
} else { } else {
$Features = (Get-WinUtilCheckBoxes)["WPFFeature"] $Features = (Get-WinUtilCheckBoxes)["WPFFeature"]
$automation = $false
} }
Invoke-WPFRunspace -ArgumentList $Features, $automation -DebugPreference $DebugPreference -ScriptBlock { Invoke-WPFRunspace -ArgumentList $Features -DebugPreference $DebugPreference -ScriptBlock {
param($Features, $automation, $DebugPreference) param($Features, $DebugPreference)
$sync.ProcessRunning = $true $sync.ProcessRunning = $true
if ($Features.count -eq 1) { if ($Features.count -eq 1) {
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" }) $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })

View File

@ -18,10 +18,8 @@ function Invoke-WPFInstall {
if ($InstallConfig) { if ($InstallConfig) {
$PackagesToInstall = $InstallConfig $PackagesToInstall = $InstallConfig
$automation = $true
} else { } else {
$PackagesToInstall = (Get-WinUtilCheckBoxes)["Install"] $PackagesToInstall = (Get-WinUtilCheckBoxes)["Install"]
$automation = $false
} }
if ($PackagesToInstall.Count -eq 0) { if ($PackagesToInstall.Count -eq 0) {
@ -31,8 +29,8 @@ function Invoke-WPFInstall {
} }
Invoke-WPFRunspace -ArgumentList $PackagesToInstall, $automation -DebugPreference $DebugPreference -ScriptBlock { Invoke-WPFRunspace -ArgumentList $PackagesToInstall -DebugPreference $DebugPreference -ScriptBlock {
param($PackagesToInstall, $automation, $DebugPreference) param($PackagesToInstall, $DebugPreference)
if ($PackagesToInstall.count -eq 1) { if ($PackagesToInstall.count -eq 1) {
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" }) $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
} else { } else {

View File

@ -18,10 +18,8 @@ function Invoke-WPFtweaksbutton {
if ($TweaksConfig) { if ($TweaksConfig) {
$Tweaks = $TweaksConfig $Tweaks = $TweaksConfig
$automation = $true
} else { } else {
$Tweaks = (Get-WinUtilCheckBoxes)["WPFTweaks"] $Tweaks = (Get-WinUtilCheckBoxes)["WPFTweaks"]
$automation = $false
} }
Set-WinUtilDNS -DNSProvider $sync["WPFchangedns"].text Set-WinUtilDNS -DNSProvider $sync["WPFchangedns"].text
@ -34,8 +32,8 @@ function Invoke-WPFtweaksbutton {
Write-Debug "Number of tweaks to process: $($Tweaks.Count)" Write-Debug "Number of tweaks to process: $($Tweaks.Count)"
Invoke-WPFRunspace -ArgumentList $Tweaks, $automation -DebugPreference $DebugPreference -ScriptBlock { Invoke-WPFRunspace -ArgumentList $Tweaks -DebugPreference $DebugPreference -ScriptBlock {
param($Tweaks, $automation, $DebugPreference) param($Tweaks, $DebugPreference)
Write-Debug "Inside Number of tweaks to process: $($Tweaks.Count)" Write-Debug "Inside Number of tweaks to process: $($Tweaks.Count)"
$sync.ProcessRunning = $true $sync.ProcessRunning = $true