- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get the Process performance counter using PowerShell?
To get all the process-related counters, you need to use the below command.
Example
Get-Counter -ListSet "*Processor*" | Select CounterSetName
Output
CounterSetName -------------- Processor Information Per Processor Network Activity Cycles Per Processor Network Interface Card Activity Hyper-V Worker Virtual Processor Hyper-V Hypervisor Virtual Processor Hyper-V Hypervisor Root Virtual Processor Hyper-V Hypervisor Logical Processor Processor Processor Performance
Now let say we need the Processor Performance counter set then we can use the below command to retrieve all its counters.
PS C:\> Get-Counter -ListSet "Processor Performance" | Select -ExpandProperty Counter \Processor Performance(*)\Processor Frequency \Processor Performance(*)\% of Maximum Frequency \Processor Performance(*)\Processor State Flags
Let assume we need the processor maximum frequency counter among this then,
Example
Get-Counter -Counter '\Processor Performance(*)\% of Maximum Frequency'
Output
To run the performance counter continuously use,
Example
Get-Counter -Counter '\Processor Performance(*)\% of Maximum Frequency' -Continuous
To retrieve the specific number of samples for the specific intervals,
Example
Get-Counter -Counter '\Processor Performance(*)\% of Maximum Frequency' -SampleInterval 2 -MaxSamples 3
Advertisements