mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-15 10:28:55 +01:00
Update check-apps.ps1
This commit is contained in:
parent
38b71f5349
commit
3876614b62
@ -1,6 +1,6 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Query application details
|
||||
Query app details
|
||||
.DESCRIPTION
|
||||
This PowerShell script queries application details and list it.
|
||||
.EXAMPLE
|
||||
@ -18,16 +18,14 @@ try {
|
||||
Write-Progress "⏳ Querying installed apps..."
|
||||
$Apps = Get-AppxPackage
|
||||
[int]$NumInstalled = $Apps.Count
|
||||
[int]$NumIssues = 0
|
||||
foreach($App in $Apps) {
|
||||
if ($App.Status -ne "Ok") { $NumIssues++ }
|
||||
}
|
||||
[int]$NumNonOk = 0
|
||||
foreach($App in $Apps) { if ($App.Status -ne "Ok") { $NumNonOk++ } }
|
||||
|
||||
Write-Progress "⏳ Querying available updates..."
|
||||
$NumUpdates = (winget upgrade --include-unknown).Count - 5
|
||||
|
||||
[int]$NumErrors = (Get-AppxLastError)
|
||||
Write-Host "✅ $NumInstalled apps installed, $NumIssues non-ok, $NumErrors errors, $NumUpdates updates available"
|
||||
Write-Host "✅ $NumInstalled apps ($NumNonOk non-ok, $NumErrors errors, $NumUpdates updates available)"
|
||||
Write-Progress -Completed " "
|
||||
}
|
||||
exit 0 # success
|
||||
|
Loading…
Reference in New Issue
Block a user