Allow testing winget packages with specific scope

This commit is contained in:
Manuel Thalmann 2024-09-03 01:16:42 +02:00
parent b3e3a84c1e
commit d2c6737798
2 changed files with 4 additions and 3 deletions

View file

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

View file

@ -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; $?; };
}
<#