mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-25 01:14:16 +01:00
Updated check-cpu.ps1 and check-smart-devices.ps1
This commit is contained in:
parent
fc66df1797
commit
6659468d18
@ -72,6 +72,8 @@ try {
|
|||||||
} elseif ($celsius -lt 0) {
|
} elseif ($celsius -lt 0) {
|
||||||
$temp = "$($celsius)°C TOO COLD"
|
$temp = "$($celsius)°C TOO COLD"
|
||||||
$status = "⚠️"
|
$status = "⚠️"
|
||||||
|
} elseif ($celsius -lt 30) {
|
||||||
|
$temp = "$($celsius)°C cool"
|
||||||
} else {
|
} else {
|
||||||
$temp = "$($celsius)°C OK"
|
$temp = "$($celsius)°C OK"
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,10 @@ try {
|
|||||||
$capacity = ""
|
$capacity = ""
|
||||||
}
|
}
|
||||||
if ($details.temperature.current -gt 50) {
|
if ($details.temperature.current -gt 50) {
|
||||||
$temp = "$($details.temperature.current)°C (!)"
|
$temp = "$($details.temperature.current)°C TOO HOT"
|
||||||
|
$status = "⚠️"
|
||||||
|
} elseif ($details.temperature.current -lt 0) {
|
||||||
|
$temp = "$($details.temperature.current)°C TOO COLD"
|
||||||
$status = "⚠️"
|
$status = "⚠️"
|
||||||
} else {
|
} else {
|
||||||
$temp = "$($details.temperature.current)°C"
|
$temp = "$($details.temperature.current)°C"
|
||||||
@ -81,13 +84,13 @@ try {
|
|||||||
$powerOn = "$($details.power_cycle_count)x on/off"
|
$powerOn = "$($details.power_cycle_count)x on/off"
|
||||||
}
|
}
|
||||||
if ($details.smart_status.passed) {
|
if ($details.smart_status.passed) {
|
||||||
$selftest = "selftest OK"
|
$selftest = "test passed"
|
||||||
} else {
|
} else {
|
||||||
$selftest = "selftest FAILED"
|
$selftest = "test FAILED"
|
||||||
$status = "⚠️"
|
$status = "⚠️"
|
||||||
}
|
}
|
||||||
$firmwareVersion = $details.firmware_version
|
$firmwareVersion = $details.firmware_version
|
||||||
Write-Host "$status $capacity$modelName via $protocol ($temp, $hours, $powerOn, v$firmwareVersion) - $selftest"
|
Write-Host "$status $capacity$modelName via $protocol ($hours, $powerOn, v$firmwareVersion) - $temp & $selftest"
|
||||||
}
|
}
|
||||||
#Write-Progress -completed "Done."
|
#Write-Progress -completed "Done."
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
|
Loading…
Reference in New Issue
Block a user