mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-25 13:36:39 +01:00
Updated check-cpu.ps1
This commit is contained in:
parent
3994d23478
commit
7bc8edc9d3
@ -42,7 +42,7 @@ function GetCPUTemperature {
|
||||
}
|
||||
|
||||
try {
|
||||
Write-Progress "Querying CPU status... "
|
||||
Write-Progress "Querying CPU status..."
|
||||
$status = "✅"
|
||||
$arch = GetCPUArchitecture
|
||||
if ($IsLinux) {
|
||||
@ -57,24 +57,24 @@ try {
|
||||
$arch = "$arch, "
|
||||
$deviceID = "$($details.DeviceID), "
|
||||
$speed = "$($details.MaxClockSpeed)MHz, "
|
||||
$socket = "$($details.SocketDesignation) socket, "
|
||||
$socket = "$($details.SocketDesignation) socket"
|
||||
}
|
||||
$cores = [System.Environment]::ProcessorCount
|
||||
$celsius = GetCPUTemperature
|
||||
if ($celsius -eq 99999.9) {
|
||||
$temp = "no temp"
|
||||
} elseif ($celsius -gt 50) {
|
||||
$temp = "$($celsius)°C"
|
||||
$temp = "$($celsius)°C HOT"
|
||||
$status = "⚠️"
|
||||
} elseif ($celsius -lt 0) {
|
||||
$temp = "$($celsius)°C"
|
||||
$temp = "$($celsius)°C COLD"
|
||||
$status = "⚠️"
|
||||
} else {
|
||||
$temp = "$($celsius)°C"
|
||||
$temp = "$($celsius)°C OK"
|
||||
}
|
||||
|
||||
Write-Host "$status $cpuName ($($arch)$cores cores, $($deviceID)$($speed)$($socket)$temp)"
|
||||
Write-Progress -completed "Done."
|
||||
Write-Host "$status $cpuName ($($arch)$cores cores, $($deviceID)$($speed)$($socket)) - $temp"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user