如何使用 Get-CimInstance 获取处理器 "SocketDesignation"?

How can I get the processor "SocketDesignation" with Get-CimInstance?

由于 Microsoft 已弃用 wmic 调用,我如何使用 Get-CimInstance 获取与 wmic cpu get SocketDesignation 相同的信息?

Win32_Processor class 有一个 SocketDesignation 属性。此命令对我产生相同的结果:

(Get-CimInstance -ClassName 'Win32_Processor' -Property 'SocketDesignation').SocketDesignation

或者,您可以使用 Get-ComputerInfo cmdlet to get instances of the Processor class, which also have a SocketDesignation property:

(Get-ComputerInfo -Property 'CsProcessors').CsProcessors.SocketDesignation

在这两个命令中,-Property 参数选择特定的属性,而不是所有可用的属性,以显示在结果中。

要获得与 wmic memorychip list full 相同的数据,您可以像上面那样查询 CIM_PhysicalMemory class or the Win32_PhysicalMemory class (the latter inherits from the former). A good way to find the WMI class that contains particular properties is to take a seemingly-unique property name, say BankLabel, and search for it on docs.microsoft.com 的实例以查看返回的 类。