The `Get-Counter '\Process(*)[process counter set]' cmdlet is slow.
- Is there a way to capture a stream of the output of the
Get-Counter
cmdlet and would that be faster? - Can the
Get-Counter
cmdlet be run in a way that the output refreshes as fast as the same information gets refreshed in the Performance Monitor or Task Manager?
Examples:
Get-Counter '\Process(*)\ID Process' -EA SilentlyContinue |
Select -Expand CounterSamples | Select InstanceName, CookedValue
Get-Counter '\Process(*)\% Processor Time' -EA SilentlyContinue |
Select -Expand CounterSamples | Select CookedValue
Get-Counter '\Process(*)\Working Set - Private' -EA SilentlyContinue |
Select -Expand CounterSamples | Select CookedValue