Home > perfmon, PowerShell > Accessing performance counters using PowerShell

Accessing performance counters using PowerShell

Using Get-Counter cmdlet in PowerShell V2, you can get performance counter values. For instance, if you want the current free memory statistics, use this command.

Get-Counter ‘MemoryAvailable MBytes’

If you want to query the counter continously, use below command.

Get-Counter ‘MemoryAvailable MBytes’ -Continous -SampleInterval 5

Here sampleinterval means how frequently you want to query the performance counter. You can need to parse a value in seconds for this.

Looks like cool right? You can do this from command prompt without powershell also, see my previous post.

Happy Learning..,
Sitaram Pamarthi

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>