Add a function for checking winget
packages
This commit is contained in:
parent
7177fa97ca
commit
d64feb232a
|
@ -42,6 +42,22 @@ function Test-ChocoPackage {
|
|||
-not [string]::IsNullOrEmpty((choco list --limit-output --exact $name));
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks whether a `winget` package with the specified id is installed.
|
||||
|
||||
.PARAMETER ID
|
||||
The id of the package to check.
|
||||
#>
|
||||
function Test-WingetPackage {
|
||||
[OutputType([bool])]
|
||||
param(
|
||||
[string] $ID
|
||||
)
|
||||
|
||||
-not (& { $null = winget list --accept-source-agreements -e --id $ID; $?; });
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks whether a command with the specified name exists.
|
||||
|
|
Loading…
Reference in a new issue