问题
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?
回答1:
@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.
来源:https://stackoverflow.com/questions/21212871/get-counter-with-locale-independent-ids