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.
This commit is contained in:
UnaTried
2025-06-26 19:14:46 +02:00
committed by GitHub
parent 91de389c8f
commit 28958938fc

View File

@ -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))