V2 Quick Tip: Monitoring Performance Counters with PowerShell

PowerShell Team

I just got a ping on our internal discussion list about how to get at the Performance counters in PowerShell.  In V2, we’ve got some nifty cmdlets to help read performance counters.

Here are a few of quick one liners to get you started:

# List all of the performance counters you can monitor
Get-Counter –listSet * | Select-Object -ExpandProperty Paths
# Get one sample of the processor time
Get-Counter '\Processor(*)\% Processor Time'
# Get a sample of the processor time until you press CTRL + C
Get-Counter '\Processor(*)\% Processor Time' -Continuous

Hope this Helps,

James Brundage [MSFT]

0 comments

Discussion is closed.

Feedback usabilla icon