mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-12-15 19:21:04 +01:00
Update check-apps.ps1
This commit is contained in:
parent
483351b9db
commit
01e8d59b7e
@ -15,20 +15,18 @@ try {
|
||||
if ($IsLinux) {
|
||||
# TODO
|
||||
} else {
|
||||
Write-Progress "⏳ Querying installed applications..."
|
||||
Write-Progress "⏳ Querying installed apps & updates..."
|
||||
$Apps = Get-AppxPackage
|
||||
$Status = "✅ $($Apps.Count) apps installed"
|
||||
|
||||
Write-Progress "⏳ Checking installed applications..."
|
||||
[int]$NumNonOk = 0
|
||||
foreach($App in $Apps) { if ($App.Status -ne "Ok") { $NumNonOk++ } }
|
||||
if ($NumNonOk -gt 0) { $Status += ", $NumNonOk non-ok" }
|
||||
[int]$NumErrors = (Get-AppxLastError)
|
||||
if ($NumErrors -gt 0) { $Status += ", $NumErrors errors" }
|
||||
|
||||
Write-Progress "⏳ Querying application upgrades..."
|
||||
$NumUpdates = (winget upgrade --include-unknown).Count - 5
|
||||
Write-Progress -Completed "Querying finished."
|
||||
Write-Progress -Completed "."
|
||||
Write-Host "$Status, $NumUpdates upgrades available"
|
||||
}
|
||||
exit 0 # success
|
||||
|
Loading…
Reference in New Issue
Block a user