diff --git a/winfetch.ps1 b/winfetch.ps1 index ef3047c..9af7650 100644 --- a/winfetch.ps1 +++ b/winfetch.ps1 @@ -687,16 +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].Trim() + $cpu = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $Env:COMPUTERNAME).OpenSubKey("HARDWARE\DESCRIPTION\System\CentralProcessor\0") + $cpuname = $cpu.GetValue("ProcessorNameString") + $cpuname = if ($cpuname.Contains('@')) { + ($cpuname -Split '@')[0].Trim() } else { - $cpu.Name.Trim() + $cpuname.Trim() } - $cpufreq = [math]::round((([int]$cpu.MaxClockSpeed)/1000), 2) return @{ title = "CPU" - content = "${cpuname} @ ${cpufreq}GHz" + content = "$cpuname @ $($cpu.GetValue("~MHz") / 1000)GHz" # [math]::Round($cpu.GetValue("~MHz") / 1000, 1) is 2-5ms slower } }