WMI can find out details about your CPUs in just one line:
PS> Get-WmiObject -Class Win32_Processor | Select-Object -Property Name, Number* Name NumberOfCores NumberOfLogicalProcessors ---- ------------- ------------------------- Intel(R) Core(TM) i7-26... 2 4