diff --git a/scripts/Common/Scripts/Software.ps1 b/scripts/Common/Scripts/Software.ps1 index b237ba2c..d8c71fe2 100644 --- a/scripts/Common/Scripts/Software.ps1 +++ b/scripts/Common/Scripts/Software.ps1 @@ -68,7 +68,7 @@ $null = New-Module { $Names.AddRange($AdditionalNames); foreach ($name in $Names) { - if ($Force.IsPresent -or -not (Test-WingetPackage $name)) { + if ($Force.IsPresent -or -not (Test-WingetPackage -Name $name @PSBoundParameters)) { winget install ` --accept-source-agreements --accept-package-agreements ` --source winget ` diff --git a/scripts/Common/Scripts/SoftwareManagement.ps1 b/scripts/Common/Scripts/SoftwareManagement.ps1 index 8eaca234..23ad951c 100644 --- a/scripts/Common/Scripts/SoftwareManagement.ps1 +++ b/scripts/Common/Scripts/SoftwareManagement.ps1 @@ -52,10 +52,11 @@ function Test-ChocoPackage { function Test-WingetPackage { [OutputType([bool])] param( - [string] $ID + [string] $Name, + [string[]] $ArgumentList ) - & { $null = winget list --accept-source-agreements -e --id $ID; $?; }; + & { $null = winget list --accept-source-agreements -e --id $Name @ArgumentList; $?; }; } <#