2

I am trying to access the following counter-path via the cmdlet get-counter in a locale-independent way:

\Memory\Pool Nonpaged Bytes

I followed the instructions in this thread to archive this. And so I looked up the two IDs for the counter-path in the registry and got \4\58
But unfortunately this path won't work. I always get the error-message

The specified performance-indicator could not be found

The path from the other thread \238(_Total)\6 works perfectly fine! But for my path I can only get \4\* to list all counters in the set.

What am I doing wrong?

Community
  • 1
  • 1
Chris_D_Turk
  • 433
  • 5
  • 13

1 Answers1

3

@Chris,

PowerShell Magazine carried an article on this a while ago.

http://www.powershellmagazine.com/2013/07/19/querying-performance-counters-from-powershell/

Tobias showed a way to translate counter names to ID numbers.

ravikanth
  • 24,922
  • 4
  • 60
  • 60
  • ok, the specified function "Get-PerformanceCounterLocalName" does work indeed. But I still don't understand why the path `\4\58` doesn't. This would be much easier because there is no extra function needed. Could you have a try on this path? – Chris_D_Turk Jan 20 '14 at 00:08
  • Make sure to replace the registry key in function `Get-PerformanceCounterID` by `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009` so you can query IDs from the english names. – zett42 Nov 04 '21 at 17:26