From 669bab0b2e0a99f5f402b378303c39b260c4b703 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Wed, 28 Dec 2022 18:21:43 +0100 Subject: [PATCH] Update check-apps.ps1 --- Scripts/check-apps.ps1 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Scripts/check-apps.ps1 b/Scripts/check-apps.ps1 index 7d465d6f..7b272ea5 100644 --- a/Scripts/check-apps.ps1 +++ b/Scripts/check-apps.ps1 @@ -15,12 +15,20 @@ try { if ($IsLinux) { # TODO } else { - Write-Progress "⏳ (1/2) Querying installed applications..." - $NumAppsInstalled = (Get-AppxPackage).Count + Write-Progress "⏳ (1/2) Querying installed apps (for current user only)..." + $Apps = Get-AppxPackage + [int]$NumInstalled = $Apps.Count + [int]$NumIssues = 0 + foreach($App in $Apps) { + if ($App.Status -ne "Ok") { $NumIssues++ } + } Write-Progress "⏳ (2/2) Querying available updates..." - $NumUpdates = (winget upgrade).Count - 5 - "✅ $NumAppsInstalled apps installed, $NumUpdates updates available" + $NumUpdates = (winget upgrade --include-unknown).Count - 5 + + Write-Progress -Completed " " + [int]$NumErrors = (Get-AppxLastError) + "✅ $NumInstalled apps installed, $NumIssues non-ok, $NumErrors errors, $NumUpdates updates available" } exit 0 # success } catch {