Some days ago I wrote about taking the leap and start using CIM instead of the good, old Get-WmiObject. I wrote the CIM function template as a result of some WMI functions that I decided to rewrite. Today I give you the first of them; Get-Cpu.

The function is rather simple, as a good function is supposed to be. It queries computers using CIM and returns an object with processor (CPU) information about the target computer.

To be able to translate the CPU family integer code into something a bit more user friendly, I created a separate function for this, so the Get-CpuFamily function is needed for Get-Cpu to work correctly. On of the reasons I decided to write a separate function for this, is that I needed the same code in another WMI function I have. Re-usability is king!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s