Skip to content

Commit

Permalink
Revert "refac(invoke-wpfuninstall.ps1): remove null assignments and s…
Browse files Browse the repository at this point in the history
…implify …" (ChrisTitusTech#2806)

This reverts commit f516c09.
  • Loading branch information
ChrisTitusTech authored and Real-MullaC committed Sep 29, 2024
1 parent d3eb6d9 commit b93dcfd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions functions/public/Invoke-WPFUnInstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ function Invoke-WPFUnInstall {

Invoke-WPFRunspace -ArgumentList @(("PackagesToInstall", $PackagesToInstall),("ChocoPreference", $ChocoPreference)) -DebugPreference $DebugPreference -ScriptBlock {
param($PackagesToInstall, $ChocoPreference, $DebugPreference)

$taskbarItemState = if ($PackagesToInstall.Count -eq 1) { "Indeterminate" } else { "Normal" }
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state $taskbarItemState -value 0.01 -overlay "logo" })

if ($PackagesToInstall.count -eq 1) {
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
} else {
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
}
$packagesWinget, $packagesChoco = {
$packagesWinget = [System.Collections.ArrayList]::new()
$packagesChoco = [System.Collections.ArrayList]::new()
Expand All @@ -46,7 +47,7 @@ function Invoke-WPFUnInstall {
$packagesWinget.add($package.winget)
Write-Host "Queueing $($package.winget) for Winget uninstall"
} else {
$packagesChoco.add($package.choco)
$null = $packagesChoco.add($package.choco)
Write-Host "Queueing $($package.choco) for Chocolatey uninstall"
}
}
Expand All @@ -55,7 +56,7 @@ function Invoke-WPFUnInstall {
$packagesChoco.add($package.choco)
Write-Host "Queueing $($package.choco) for Chocolatey uninstall"
} else {
$packagesWinget.add($($package.winget))
$null = $packagesWinget.add($($package.winget))
Write-Host "Queueing $($package.winget) for Winget uninstall"
}
}
Expand Down

0 comments on commit b93dcfd

Please sign in to comment.