Listing processes by CPU usage percentage in powershell

If you want CPU percentage, you can use Get-Counter to get the performance counter and Get-Counter can be run for all processes. So, to list processes that use greater than say 5% of CPU use:

(Get-Counter '\Process(*)\% Processor Time').CounterSamples | Where-Object {$_.CookedValue -gt 5}

This will list the processes that was using >5% of CPU at the instance the sample was taken. Hope this helps!

Leave a Comment