Refactor winget
check for rare issue
This commit is contained in:
parent
050221da47
commit
4e97645eea
1 changed files with 8 additions and 4 deletions
|
@ -78,10 +78,14 @@ function Test-Command {
|
|||
Checks whether `winget` is working properly.
|
||||
#>
|
||||
function Test-Winget {
|
||||
(Test-Command winget) -and -not (
|
||||
[System.Linq.Enumerable]::Any(
|
||||
[string[]](winget source update winget),
|
||||
(Test-Command winget) -and (
|
||||
& {
|
||||
$output = winget source update winget;
|
||||
|
||||
$? -and -not ([System.Linq.Enumerable]::Any(
|
||||
[string[]]($output),
|
||||
[System.Func[string,bool]]{ param($line) $line -eq "Cancelled"; }));
|
||||
});
|
||||
}
|
||||
|
||||
<#
|
||||
|
|
Loading…
Reference in a new issue