Search code examples
powershellperformancecounter

How to select a performance counter with Get-Counter with * in name


When I try to select a counter of which I know the name and the fact that is exists, like for example Get-Counter -ListSet '\ProcessorPerformance(*)\frequency' | Select-Object -ExpandProperty Counter, I get the error that:

Get-Counter : Cannot find any performance counter sets on the localhost computer that match the following: \ProcessorPerformance(*)\frequency. At line:1 char:1

How can I get a counter when I know the full name or path?


Solution

  • maybe you can find help on the scripting guy site :

    (Get-Counter -ListSet 'processor information').paths  | get-counter