Update check-cpu-temp.ps1

This commit is contained in:
Markus Fleschutz 2021-10-17 12:16:06 +02:00 committed by GitHub
parent 7b898d7180
commit bd616fd925
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,7 @@
This script checks the CPU temperature. This script checks the CPU temperature.
.EXAMPLE .EXAMPLE
PS> ./check-cpu-temp PS> ./check-cpu-temp
30.3 °C CPU temperature - good CPU has 30.3 °C: good
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -23,16 +23,16 @@ try {
} }
if ($Temp -gt 80) { if ($Temp -gt 80) {
"⚠️ $Temp °C CPU temperature: too high!" "⚠️ CPU has $Temp °C: too high!"
exit 1 exit 1
} elseif ($Temp -gt 50) { } elseif ($Temp -gt 50) {
"✔️ $Temp °C CPU temperature: quite high" "✔️ CPU has $Temp °C: quite high"
} elseif ($Temp -gt 0) { } elseif ($Temp -gt 0) {
"✔️ $Temp °C CPU temperature: good" "✔️ CPU has $Temp °C: good"
} elseif ($Temp -gt -20) { } elseif ($Temp -gt -20) {
"✔️ $Temp °C CPU temperature: quite low" "✔️ CPU has $Temp °C: quite low"
} else { } else {
"⚠️ $Temp °C CPU temperature: too low!" "⚠️ CPU has $Temp °C: too low!"
exit 1 exit 1
} }
exit 0 # success exit 0 # success