mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-23 02:10:39 +02:00
Updated the manuals
This commit is contained in:
@@ -74,26 +74,31 @@ try {
|
||||
$details = Get-WmiObject -Class Win32_Processor
|
||||
$cpuName = $details.Name.trim()
|
||||
$arch = "$arch, "
|
||||
$deviceID = "$($details.DeviceID), "
|
||||
$speed = "$($details.MaxClockSpeed)MHz, "
|
||||
$socket = "$($details.SocketDesignation) socket"
|
||||
$deviceID = ", $($details.DeviceID)"
|
||||
$speed = ", $($details.MaxClockSpeed)MHz"
|
||||
$socket = ", $($details.SocketDesignation) socket"
|
||||
}
|
||||
$cores = [System.Environment]::ProcessorCount
|
||||
$celsius = GetCPUTemperature
|
||||
if ($celsius -eq 99999.9) {
|
||||
$temp = "no temp"
|
||||
$temp = ""
|
||||
} elseif ($celsius -gt 80) {
|
||||
$temp = ", $($celsius)°C TOO HOT"
|
||||
$status = "⚠️"
|
||||
} elseif ($celsius -gt 50) {
|
||||
$temp = "$($celsius)°C HOT"
|
||||
$temp = ", $($celsius)°C HOT"
|
||||
$status = "⚠️"
|
||||
} elseif ($celsius -lt 0) {
|
||||
$temp = "$($celsius)°C COLD"
|
||||
$temp = ", $($celsius)°C TOO COLD"
|
||||
$status = "⚠️"
|
||||
} elseif ($celsius -lt 30) {
|
||||
$temp = ", $($celsius)°C cool"
|
||||
} else {
|
||||
$temp = "$($celsius)°C OK"
|
||||
$temp = ", $($celsius)°C"
|
||||
}
|
||||
|
||||
Write-Progress -completed "Done."
|
||||
Write-Host "$status $cpuName ($($arch)$cores cores, $($deviceID)$($speed)$($socket)) - $temp"
|
||||
Write-Host "$status $cpuName ($($arch)$cores cores$($temp)$($deviceID)$($speed)$($socket))"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
@@ -101,4 +106,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-cpu.ps1 as of 08/15/2024 09:50:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-cpu.ps1 as of 11/08/2024 12:34:46)*
|
||||
|
Reference in New Issue
Block a user