Compare commits

..

No commits in common. "khaleel/eng-3962-wmic-cpu-get-addresswidthcaptionmanufacturer-formatcsv" and "main" have entirely different histories.

View File

@ -1936,13 +1936,13 @@ def get_cpu_info() -> CpuInfo | None:
cpuinfo = {} cpuinfo = {}
try: try:
if platform_os == "Windows": if platform_os == "Windows":
cmd = 'powershell -Command "Get-CimInstance Win32_Processor | Select-Object AddressWidth,Manufacturer,Name | ConvertTo-Json"' cmd = "wmic cpu get addresswidth,caption,manufacturer /FORMAT:csv"
output = processes.execute_command_and_return_output(cmd) output = processes.execute_command_and_return_output(cmd)
if output: if output:
cpu_data = json.loads(output) val = output.splitlines()[-1].split(",")[1:]
cpuinfo["address_width"] = cpu_data["AddressWidth"] cpuinfo["manufacturer_id"] = val[2]
cpuinfo["manufacturer_id"] = cpu_data["Manufacturer"] cpuinfo["model_name"] = val[1].split("Family")[0].strip()
cpuinfo["model_name"] = cpu_data["Name"] cpuinfo["address_width"] = format_address_width(val[0])
elif platform_os == "Linux": elif platform_os == "Linux":
output = processes.execute_command_and_return_output("lscpu") output = processes.execute_command_and_return_output("lscpu")
if output: if output: