How to get top 5 highest CPU consuming processes and their thread count using powershell command?
Need values of CPU, ProcessName, PID, Thread count
1 Answer
You can try:
Get-Process | Sort-Object CPU -Desc | Select-Object ID, Name, CPU, @{Name='ThreadCount';Expression ={$_.Threads.Count}} -First 5 Id Name CPU ThreadCount -- ---- --- ----------- 4 System 12803.21875 276 6616 sqlservr 11645.328125 63 1736 dwm 10635.78125 14 5648 msedge 9159.609375 17
16216 msedge 8914.96875 13