get-counter with locale independent IDs

寵の児 提交于 2019-12-12 22:16:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!