Read Performance Counters With Get-Counter

Sample CPU, disk, memory and custom counters as objects.

WindowsmonitoringperformancepowershellLow risk
Run Get-Counter '\Processor(_Total)\% Processor Time' -SampleInterval 1 -MaxSamples 5.

01Command

Command
$ Get-Counter '\Processor(_Total)\% Processor Time' -SampleInterval 1 -MaxSamples 5

02What it does

Get-Counter returns counter data as objects that can be filtered, compared or exported to CSV, and it accepts -ComputerName for remote hosts. That makes threshold checks and trend logs scriptable instead of relying on PerfMon graphs by eye.

03Risk

RiskLow risk
RequirementsWindows 10/11 with PowerShell 5.1 or PowerShell 7+
!Warning: Counter names are localized and must be quoted correctly; use -ListSet to discover them on a given system.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Get-Counter
    Microsoft Learn · vendor-doc · 2026-09-20
    Evidence: Reads performance counter samples, including remote computers.

Last verified: 2026-10-13 · Category: System & Settings

06Related solutions