Get-Counter
Use Get-Counter to read Windows performance counter values, once or as a continuous sample.
Documentation: Microsoft Learn — get-counter
Syntax
See the command anatomy
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Get-Counter [-Counter] <String[]> [-SampleInterval <Int32>] [-MaxSamples <Int64>] [<CommonParameters>]
Get-Counter -ListSet <String[]> [<CommonParameters>]- Stage 1Get-Counter
-Counter -SampleInterval -MaxSamples -ListSet
Try it
PowerShell example · browser support is limited.
Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.
Follow the objects
Run the command to inspect each stage.
Examples
Get-Counter -Counter "\Processor(_Total)\% Processor Time"
Show reference output
Illustrative output · values vary by environment
Timestamp CounterSamples --------- -------------- 10/01/2026 09:00:00 \processor(_total)\% processor time : 12.48 10/01/2026 09:00:01 \processor(_total)\% processor time : 18.06 10/01/2026 09:00:02 \processor(_total)\% processor time : 15.22
Get-Counter -ListSet Processor
Show reference output
Illustrative output · values vary by environment
\Processor(*)\% Processor Time \Processor(*)\% User Time \Processor(*)\% Privileged Time
Get-Counter -Counter "\Memory\Available MBytes"
Show reference output
Illustrative output · values vary by environment
Timestamp CounterSamples --------- -------------- 10/01/2026 09:00:00 \memory\available mbytes : 6144 10/01/2026 09:00:02 \memory\available mbytes : 6128 10/01/2026 09:00:04 \memory\available mbytes : 6100 10/01/2026 09:00:06 \memory\available mbytes : 6152 10/01/2026 09:00:08 \memory\available mbytes : 6160
Parameters
Parameter definitions:
-Counter-SampleInterval-MaxSamples-Continuous-ComputerName-ListSet
Read the right counter and sample count
Get-Counter reads Windows performance counters. Counter-set and counter names can be localized: discover valid paths with -ListSet on the target computer rather than assuming an English path exists everywhere.
Sampling and output
-MaxSamples limits the number of samples; -SampleInterval controls the interval in seconds. -Continuous keeps collecting until interrupted. Each measurement contains a timestamp and a CounterSamples collection; inspect its CookedValue for a numerical value.
Discovery is a different operation
-ListSet returns counter-set information, not measurements. Expanding its Paths property gives path strings. Some counter sets need elevated access. If a counter is missing, first check its name, target availability and permissions.
A short sample is a point-in-time observation, not a capacity trend. Choose a meaningful measurement period before drawing conclusions.
Summarize numeric object properties
Updated 1 October 2026. Browser outputs are fictional; check the installed module help for your environment.
Recap
Get-Counter Use Get-Counter to read Windows performance counter values, once or as a continuous sample.
Next: Get-AuthenticodeSignature