Report MaxClockSpeed in CPU (#144)

* Report MaxClockSpeed in CPU

* Round off to GHz
This commit is contained in:
Rashil Gandhi
2022-08-15 19:17:32 +05:30
committed by GitHub
parent ca50dc997b
commit e5cd798a62
+8 -1
View File
@@ -687,9 +687,16 @@ function info_theme {
# ===== CPU/GPU =====
function info_cpu {
$cpu = Get-CimInstance -ClassName Win32_Processor -Property Name,MaxClockSpeed -CimSession $cimSession
$cpuname = if ($cpu.Name.Contains('@')) {
($cpu.Name -Split ' @ ')[0]
} else {
$cpu.Name
}
$cpufreq = [math]::round((([int]$cpu.MaxClockSpeed)/1000), 2)
return @{
title = "CPU"
content = (Get-CimInstance -ClassName Win32_Processor -Property Name -CimSession $cimSession).Name
content = "${cpuname} @ ${cpufreq}GHz"
}
}