I am looking for a PowerShell cmdlet that can provide similar functionality to the Linux Top app. Something that refreshes at some given interval and displays the process list with CPU % util.

I have seen scripts that list CPU % utilization in a loop but something like top would be way more handy as we have setup SSH/Powershell access for management (I still prefer a putty shell!)

link|improve this question
This falls squarely in the superuser.com category of questions. – Gabe Aug 15 '10 at 1:26
Cool -didnt realize that site even existed! (I am primarily a C# developer) – TimAtVenturality Aug 15 '10 at 2:37
feedback

migrated from stackoverflow.com Aug 17 '10 at 0:43

This question came from our site for professional and enthusiast programmers.

2 Answers

There's nothing that I know of that in single cmdlet form, but like you say, scripts are easy to right to emulate top.

while (1) { ps | sort -desc cpu | select -first 30; sleep -seconds 2; cls }
link|improve this answer
close enough - I can tweak it from here... well, done! (I am a C# developer, but manage our servers too - so coming up the PowerShell curve...) – TimAtVenturality Aug 15 '10 at 2:35
if you want to learn more - by example - check out www.poshcode.org – x0n Aug 15 '10 at 16:35
@TimAtVenturality - You can wrap the script as a function with parameters to more closely replicate top. – Joe Internet Aug 17 '10 at 1:56
feedback

I'm not aware of a PowerShell cmdlet that provides the functionality. There is a freeware external command that does about what you want. Look at Mark Russinovich's pslist from the Sysinternals suite. Pslist provides a list of executing processes in a configurable view. "pslist -s" provides the sort of continuous update you want, with a default refresh rate of once per second.

I prefer to use Mark's GUI Process Explorer, but pslist is handy for console sessions.

The Sysinternals home page is here: http://technet.microsoft.com/en-us/sysinternals

Dennis

link|improve this answer
feedback

Your Answer

 
or
required, but never shown