mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-05 20:46:43 +02:00
Add CPU temperature for Windows
This commit is contained in:
parent
285895f4ae
commit
e168150f2a
@ -10,8 +10,9 @@ try {
|
|||||||
[int]$IntTemp = get-content "/sys/class/thermal/thermal_zone0/temp"
|
[int]$IntTemp = get-content "/sys/class/thermal/thermal_zone0/temp"
|
||||||
$Temp = [math]::round($IntTemp / 1000.0, 1)
|
$Temp = [math]::round($IntTemp / 1000.0, 1)
|
||||||
} else {
|
} else {
|
||||||
write-warning "Sorry, no CPU temperature available"
|
$data = Get-WMIObject -Query "SELECT * FROM Win32_PerfFormattedData_Counters_ThermalZoneInformation" -Namespace "root/CIMV2"
|
||||||
exit 0
|
$Temp = @($data)[0].HighPrecisionTemperature
|
||||||
|
$Temp = [math]::round($Temp / 1000.0, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($Temp -gt "80") {
|
if ($Temp -gt "80") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user