PowerShell: Check Number of CPU Cores

Need to check how many cores a processor has - for performance planning, licensing checks, or confirming hardware specs? This one-liner pulls it straight from the system.

Prerequisites:

  • Privileges: None
  • Module: Built-in, no import needed

Quick Command:

Get-CimInstance -ClassName Win32_Processor | Select-Object Name, NumberOfCores

Example Output:

Name                        NumberOfCores
----                        -------------
Intel(R) Core(TM) i5-14500T            14
📦
Want all of them at once?
Get every free one-liner from this blog in a single downloadable bundle organized by category, each with full comment-based help. No more copy-pasting one at a time.

How It Works:

  • Get-CimInstance -ClassName Win32_Processor queries the processor class, which reports details about each physical CPU installed in the system.
  • Name shows the exact processor model as reported by the manufacturer.
  • NumberOfCores returns the number of physical cores on that processor - not to be confused with logical processors (threads), which can be higher if the CPU supports hyper-threading.