mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-25 17:33:17 +01:00
Update check-apps.ps1 and check-software.ps1
This commit is contained in:
parent
f73f8b3ccb
commit
f6da1a39f7
@ -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 {
|
||||
|
@ -7,7 +7,8 @@
|
||||
PS> ./check-software.ps1
|
||||
|
||||
S O F T W A R E
|
||||
✅ BIOS 'P62 v02.67', release HPQOEM - 0, S/N CZC448B9C1 by HP
|
||||
✅ BIOS model 'P62 v02.67' version HPQOEM - 0 by HP
|
||||
✅ Windows 10 Pro 64-Bit (v10.0.19045, since 5/2/2021)
|
||||
...
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
@ -19,8 +20,8 @@
|
||||
& "$PSScriptRoot/write-green.ps1" " S O F T W A R E"
|
||||
& "$PSScriptRoot/check-bios.ps1"
|
||||
& "$PSScriptRoot/check-os.ps1"
|
||||
& "$PSScriptRoot/check-powershell.ps1"
|
||||
& "$PSScriptRoot/check-apps.ps1"
|
||||
& "$PSScriptRoot/check-powershell.ps1"
|
||||
& "$PSScriptRoot/check-uptime.ps1"
|
||||
& "$PSScriptRoot/check-time-zone.ps1"
|
||||
& "$PSScriptRoot/check-swap-space.ps1"
|
||||
|
Loading…
Reference in New Issue
Block a user