mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-14 06:48:46 +02:00
Update check-apps.ps1 and check-software.ps1
This commit is contained in:
@ -2,10 +2,10 @@
|
||||
.SYNOPSIS
|
||||
Query the app status
|
||||
.DESCRIPTION
|
||||
This PowerShell script queries the application status and prints it.
|
||||
This PowerShell script queries the installed applications and prints it.
|
||||
.EXAMPLE
|
||||
PS> ./check-apps.ps1
|
||||
✅ 119 apps installed, 11 upgrades available
|
||||
✅ 119 Windows apps installed, 11 upgrades available
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -17,9 +17,10 @@ try {
|
||||
$NumSnaps = (snap list).Count - 1
|
||||
Write-Host "✅ $($NumSnaps) snaps installed"
|
||||
} else {
|
||||
Write-Progress "⏳ Querying installed apps and updates..."
|
||||
Write-Progress "⏳ Querying installed applications..."
|
||||
$Apps = Get-AppxPackage
|
||||
$Status = "✅ $($Apps.Count) apps installed"
|
||||
Write-Progress -Completed "."
|
||||
Write-Host "✅ $($Apps.Count) Windows apps installed, " -noNewline
|
||||
|
||||
[int]$NumNonOk = 0
|
||||
foreach($App in $Apps) { if ($App.Status -ne "Ok") { $NumNonOk++ } }
|
||||
@ -28,8 +29,7 @@ try {
|
||||
if ($NumErrors -gt 0) { $Status += ", $NumErrors errors" }
|
||||
|
||||
$NumUpdates = (winget upgrade --include-unknown).Count - 5
|
||||
Write-Progress -Completed "."
|
||||
Write-Host "$Status, $NumUpdates upgrades available"
|
||||
Write-Host "$NumUpdates upgrades available"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
|
Reference in New Issue
Block a user