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!