WMI enables you find the number of processors in your system:
PS> Get-WmiObject -Class Win32_ComputerSystem | fl Number*
NumberOfLogicalProcessors : 2
NumberOfProcessors : 1
This works fine for Windows Vista/Windows 2008 and above.
Earlier versions of Windows mis-report the number of processors â€“ it counts the number of logical processors reports it as the number of physical processors.
Win32_Processor has the same problem on Windows 2003 and below.
There is a hotfix available from http://support.microsoft.com/kb/932370 that will correct the behaviour of these two WMI classes so that they report correctly