1

Since wmic calls are deprecated by Microsoft, how can I use Get-CimInstance to get the same information as wmic cpu get SocketDesignation?

Lance U. Matthews
  • 15,725
  • 6
  • 48
  • 68
golo
  • 41
  • 7

2 Answers2

0

The Win32_Processor class has a SocketDesignation property. This command produces the same result for me:

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

Alternatively, you can use the Get-ComputerInfo cmdlet to get instances of the Processor class, which also have a SocketDesignation property:

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

In both commands, the -Property parameter is selecting specific properties, instead of all available, to be present in the result.

To get the same data as wmic memorychip list full you would query, as above, for instances of the 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 learn.microsoft.com to see what classes are returned.

Lance U. Matthews
  • 15,725
  • 6
  • 48
  • 68
  • what are the technical aspects or domain related to the above implementation? Is it related to windows drivers? – golo Dec 17 '21 at 08:31
  • wmic memorychip list full --- what will be its equivalent here using get-CimInstance? – golo Dec 17 '21 at 08:36
  • I have updated my answer with the classes used by the `wmic memorychip` alias. For most hardware I would expect it's up to the driver to implement the respective WMI class properly, but for driver-less components such as processor and memory I would imagine Windows is just querying them directly. – Lance U. Matthews Dec 19 '21 at 21:12
0

you can simply type the following command.

(Get-CimInstance CIM_Processor).SocketDesignation
Malachi
  • 53
  • 6