mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 13:04:59 +02:00
Update check-apps.ps1 and check-cpu.ps1
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Query application details
|
Query application details
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script queries and lists application details.
|
This PowerShell script queries application details and list it.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./check-apps
|
PS> ./check-apps
|
||||||
.LINK
|
.LINK
|
||||||
@ -12,9 +12,14 @@
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if ($IsLinux) {
|
||||||
|
# TODO
|
||||||
|
} else {
|
||||||
|
Write-Progress "Querying installed apps and available updates..."
|
||||||
$NumAppsInstalled = (Get-AppxPackage).Count
|
$NumAppsInstalled = (Get-AppxPackage).Count
|
||||||
$NumUpdates = (winget upgrade).Count - 5
|
$NumUpdates = (winget upgrade).Count - 5
|
||||||
"✅ $NumAppsInstalled apps installed, $NumUpdates updates available"
|
"✅ $NumAppsInstalled apps installed, $NumUpdates updates available"
|
||||||
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -43,7 +43,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($IsLinux) {
|
if ($IsLinux) {
|
||||||
"✅ CPU is $Temp"
|
"✅ CPU has $Temp"
|
||||||
} else {
|
} else {
|
||||||
$Details = Get-WmiObject -Class Win32_Processor
|
$Details = Get-WmiObject -Class Win32_Processor
|
||||||
$CPUName = $Details.Name.trim()
|
$CPUName = $Details.Name.trim()
|
||||||
|
Reference in New Issue
Block a user