Update check-cpu-temp.ps1

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

View File

@ -22,18 +22,18 @@ try {
$Temp = [math]::round($Temp / 100.0, 1) $Temp = [math]::round($Temp / 100.0, 1)
} }
if ($Temp -gt "80") { if ($Temp -gt 80) {
write-error "⚠️ $Temp °C CPU temperature is too high!" "⚠️ $Temp °C CPU temperature: too high!"
exit 1 exit 1
} elseif ($Temp -lt "-20") { } elseif ($Temp -gt 50) {
write-error "⚠️ $Temp °C CPU temperature is too low!" "✔️ $Temp °C CPU temperature: quite high"
exit 1 } elseif ($Temp -gt 0) {
} elseif ($Temp -gt "50") { "✔️ $Temp °C CPU temperature: good"
"✔️ $Temp °C CPU temperature - quite high" } elseif ($Temp -gt -20) {
} elseif ($Temp -lt "0") { "✔️ $Temp °C CPU temperature: quite low"
"✔️ $Temp °C CPU temperature - quite low"
} else { } else {
"✔️ $Temp °C CPU temperature - good" "⚠️ $Temp °C CPU temperature: too low!"
exit 1
} }
exit 0 # success exit 0 # success
} catch { } catch {