You may want to ask the scripting experts over in their forum - https://social.technet.microsoft.com/Forums/en-US/home?forum=ITCG
Or post to the new location at https://learn.microsoft.com/en-us/answers/topics/windows-server-powershell.html
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
As you already may know each Performance Monitor counter has the corresponding ID which you can find in the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009\Counter
So theoretically we can get the counter value by typing
Get-Counter -Counter "\2\10" instead of
Get-Counter -Counter "\System\File Read Operations/sec" - and it does work:
But I don't understand why other counters may not be read by such method:
Get-Counter -Counter "\System\File Read Operations/sec"
What;s wrong with the second query?
Thank you in advance,
Michael
You may want to ask the scripting experts over in their forum - https://social.technet.microsoft.com/Forums/en-US/home?forum=ITCG
Or post to the new location at https://learn.microsoft.com/en-us/answers/topics/windows-server-powershell.html
Here's one more example: