mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-29 22:48:50 +02:00
Update check-apps.ps1
This commit is contained in:
parent
4ada589b40
commit
669bab0b2e
@ -15,12 +15,20 @@ try {
|
|||||||
if ($IsLinux) {
|
if ($IsLinux) {
|
||||||
# TODO
|
# TODO
|
||||||
} else {
|
} else {
|
||||||
Write-Progress "⏳ (1/2) Querying installed applications..."
|
Write-Progress "⏳ (1/2) Querying installed apps (for current user only)..."
|
||||||
$NumAppsInstalled = (Get-AppxPackage).Count
|
$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..."
|
Write-Progress "⏳ (2/2) Querying available updates..."
|
||||||
$NumUpdates = (winget upgrade).Count - 5
|
$NumUpdates = (winget upgrade --include-unknown).Count - 5
|
||||||
"✅ $NumAppsInstalled apps installed, $NumUpdates updates available"
|
|
||||||
|
Write-Progress -Completed " "
|
||||||
|
[int]$NumErrors = (Get-AppxLastError)
|
||||||
|
"✅ $NumInstalled apps installed, $NumIssues non-ok, $NumErrors errors, $NumUpdates updates available"
|
||||||
}
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user