Educating the world

Our blog has over 10,000 readers a month

« Scripting with Windows PowerShell Part 3Channel 4's Campus - Analysis of Men and Women »


Comment from: Aslesh [Visitor]


could you please help me how can i get only processes running from last 2 hours.

i tried using where object, but it didnt work for me

03/09/15 @ 17:47
Comment from: davidnewcomb [Member]  

Something like:

get-process | ? { ([DateTime]::Now - $_.StartTime).TotalSeconds -gt 7200 }

Where 7200 is the number of seconds in 2 hours.

04/09/15 @ 07:20

Leave a comment

Your email address will not be revealed on this site.

Your URL will be displayed.
(For my next comment on this site)
(Allow users to contact me through a message form -- Your email will not be revealed!)