mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-12-15 19:21:04 +01:00
Added check-apps.ps1
This commit is contained in:
parent
b03cb29ec8
commit
66fa70a2aa
22
Scripts/check-apps.ps1
Normal file
22
Scripts/check-apps.ps1
Normal file
@ -0,0 +1,22 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Query application details
|
||||
.DESCRIPTION
|
||||
This PowerShell script queries and lists application details.
|
||||
.EXAMPLE
|
||||
PS> ./check-apps
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
$NumAppsInstalled = (Get-AppxPackage).Count
|
||||
$NumUpdates = (winget upgrade).Count - 5
|
||||
"✅ $NumAppsInstalled apps installed, $NumUpdates updates available"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
@ -24,6 +24,7 @@
|
||||
& "$PSScriptRoot/write-green.ps1" " S O F T W A R E"
|
||||
& "$PSScriptRoot/check-os.ps1"
|
||||
& "$PSScriptRoot/check-powershell.ps1"
|
||||
& "$PSScriptRoot/check-apps.ps1"
|
||||
& "$PSScriptRoot/check-uptime.ps1"
|
||||
& "$PSScriptRoot/check-time-zone.ps1"
|
||||
& "$PSScriptRoot/check-swap-space.ps1"
|
||||
|
Loading…
Reference in New Issue
Block a user