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