Locale independent Windows Performance Counters on multiple server versions

142 views Asked by At

I tried to read value of a Performance counter with code below:

(Get-Counter '\Processor(_Total)\% Processor Time').CounterSamples[0].CookedValue;

This is a language dependent command, so tried to make this language independent with code below:

(Get-Counter '\238(_Total)\6').CounterSamples[0].CookedValue;

It is locale independent, but I found it isn't working on Windows Server 2003 based systems, because this object wasn't defined yet in this version. How could I make this working also on Server 2003?

0

There are 0 answers