From 28958938fc0e1009c5a1c772ed6dcafc572e4605 Mon Sep 17 00:00:00 2001 From: UnaTried <103455203+UnaTried@users.noreply.github.com> Date: Thu, 26 Jun 2025 19:14:46 +0200 Subject: [PATCH] Fixing the winget `installing 0 failed` error (#3391) It just adds the `$null =` from the else to the start of the add line if the package is equal to `na`. For winget the package added is put into an extra set of $(), because of how it is in the else. I haven't tested it without. --- functions/private/Get-WinUtilSelectedPackages.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/private/Get-WinUtilSelectedPackages.ps1 b/functions/private/Get-WinUtilSelectedPackages.ps1 index af4bb1ef..b9f1e86d 100644 --- a/functions/private/Get-WinUtilSelectedPackages.ps1 +++ b/functions/private/Get-WinUtilSelectedPackages.ps1 @@ -33,7 +33,7 @@ function Get-WinUtilSelectedPackages "Choco" { if ($package.choco -eq "na") { Write-Debug "$($package.content) has no Choco value." - $packagesWinget.add($package.winget) + $null = $packagesWinget.add($($package.winget)) Write-Host "Queueing $($package.winget) for Winget" } else { $null = $packagesChoco.add($package.choco) @@ -44,7 +44,7 @@ function Get-WinUtilSelectedPackages "Winget" { if ($package.winget -eq "na") { Write-Debug "$($package.content) has no Winget value." - $packagesChoco.add($package.choco) + $null = $packagesChoco.add($package.choco) Write-Host "Queueing $($package.choco) for Chocolatey" } else { $null = $packagesWinget.add($($package.winget))