Allow testing winget packages with specific scope

This commit is contained in:
Manuel Thalmann 2024-09-03 01:16:42 +02:00
parent abb07af518
commit 14cdf638f5
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 @PSBoundParameters)) {
winget install `
--accept-source-agreements --accept-package-agreements `
--source winget `

View file

@ -53,10 +53,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; $?; };
}
<#