Does Get-Counter to remote computers use WMI or CIM under the covers?

If I’m going to be using Get-Counter a lot I’d like to know if it’s using the heavyweight WMI or lightweight CIM under the covers.

If we don’t know is it possible to work it out through monitoring the remote end and looking for something in particular? (I’m not sure how to do this but if there are ideas to get me started I can give it a shot; for example I’m not sure how the Wireshark trace would look, but if nobody knows I could try WMI and CIM queries to see if I can find the difference and then try Get-Counter).

And if it turned out it still uses WMI, does anyone have any pointers on how to roll a CIM equivalent version to read performance counters? I imagine that would be cool seeing as you can open the connection once and re-use it over and over. I’m just not sure which classes you’d target.

Hi Cody,

Get-Counter is wrapping the Windows Performance Counter functions which are using Remote Procedure Calls (RPC) instead of WIM or CIM.

https://msdn.microsoft.com/en-us/library/windows/desktop/aa373078(v=vs.85).aspx

Regards,
Daniel