Update the manuals

This commit is contained in:
Markus Fleschutz
2022-12-04 10:40:18 +01:00
parent fdaa75ddfd
commit 6df3796258
520 changed files with 1470 additions and 923 deletions

View File

@@ -1,4 +1,4 @@
## The *check-cpu.ps1* PowerShell Script
## The *check-cpu.ps1* Script
check-cpu.ps1
@@ -16,12 +16,12 @@ check-cpu.ps1
```powershell
<#
.SYNOPSIS
Checks the CPU temperature
Queries and prints CPU details
.DESCRIPTION
This PowerShell script queries the CPU temperature and returns it.
This PowerShell script queries CPU details (name, type, speed, temperature, etc.) and prints it.
.EXAMPLE
PS> ./check-cpu
CPU is 30.3°C warm.
CPU AMD Ryzen 5 5500U with Radeon Graphics (CPU0, 2100MHz, 31.3°C)
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@@ -46,23 +46,27 @@ function GetCPUTemperatureInCelsius {
}
try {
Write-Progress "Querying CPU details ..."
$Celsius = GetCPUTemperatureInCelsius
if ($Celsius -eq 99999.9) {
$Temp = "no temp"
} elseif ($Celsius -gt 50) {
$Temp = "$($Celsius)°C hot"
} elseif ($Celsius -gt 0) {
$Temp = "$($Celsius)°C warm"
$Temp = "⚠️$($Celsius)°C"
} elseif ($Celsius -lt 0) {
$Temp = "⚠️$($Celsius)°C"
} else {
$Temp = "$($Celsius)°C cold"
$Temp = "$($Celsius)°C"
}
if ($IsLinux) {
"✅ CPU is $Temp."
"✅ CPU has $Temp"
} else {
$Details = Get-WmiObject -Class Win32_Processor
$DeviceName = $Details.Name.trim()
"✅ $($DeviceName): $($Details.DeviceID), $($Details.MaxClockSpeed)MHz, $Temp"
$CPUName = $Details.Name.trim()
$DeviceID = $Details.DeviceID
$Speed = "$($Details.MaxClockSpeed)MHz"
$Socket = $Details.SocketDesignation
"✅ CPU $CPUName ($DeviceID, $Speed, socket $Socket, $Temp)"
}
exit 0 # success
} catch {