Allow testing winget
packages with specific scope
This commit is contained in:
parent
b3e3a84c1e
commit
d2c6737798
2 changed files with 4 additions and 3 deletions
|
@ -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 `
|
||||
|
|
|
@ -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; $?; };
|
||||
}
|
||||
|
||||
<#
|
||||
|
|
Loading…
Reference in a new issue