mirror of
https://github.com/lptstr/winfetch.git
synced 2026-09-26 00:50:24 -04:00
Report MaxClockSpeed in CPU (#144)
* Report MaxClockSpeed in CPU * Round off to GHz
This commit is contained in:
+8
-1
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user