Enhance the winget
install check
This commit is contained in:
parent
0b28364280
commit
7177fa97ca
2 changed files with 12 additions and 1 deletions
scripts/Windows/Scripts
|
@ -57,6 +57,17 @@ function Test-Command {
|
|||
[bool] (Get-Command $Name -ErrorAction SilentlyContinue);
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks whether `winget` is working properly.
|
||||
#>
|
||||
function Test-Winget {
|
||||
(Test-Command winget) -and -not (
|
||||
[System.Linq.Enumerable]::Any(
|
||||
[string[]](winget source update winget),
|
||||
[System.Func[string,bool]]{ param($line) $line -eq "Cancelled"; }));
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks whether a package with the specified name is installed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue