Improve winget function

This commit is contained in:
Manuel Thalmann 2024-08-08 04:28:21 +02:00
parent e29e36acf7
commit ddfbe17a49

View file

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