Improve winget function
This commit is contained in:
parent
e29e36acf7
commit
ddfbe17a49
1 changed files with 7 additions and 1 deletions
|
@ -56,10 +56,16 @@ $null = New-Module {
|
|||
function Install-WingetPackage {
|
||||
param(
|
||||
[switch] $Force,
|
||||
[Parameter(Position=0)]
|
||||
[string] $Name,
|
||||
[Parameter(ValueFromRemainingArguments = $true)]
|
||||
[string[]] $Names
|
||||
[string[]] $AdditionalNames = @()
|
||||
)
|
||||
|
||||
[System.Collections.ArrayList] $Names = @();
|
||||
$null = $Names.Add($Name);
|
||||
$Names.AddRange($AdditionalNames);
|
||||
|
||||
foreach ($name in $Names) {
|
||||
if ($Force.IsPresent -or -not (Test-WingetPackage $name)) {
|
||||
winget install `
|
||||
|
|
Loading…
Reference in a new issue