Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


the powershell can monitor the cpu?

 
Logged in as: Guest
arrSession:exec spGetSession 2,5,48090
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Windows PowerShell >> the powershell can monitor the cpu?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 the powershell can monitor the cpu? - 6/8/2007 10:16:53 PM   
  sensen9966

 

Posts: 4
Score: 0
Joined: 5/14/2007
Status: offline
i have a requirement about the following things.

sometimes i process a simulation using some software in a computer, so i waited until he finished by doing some other things in another computer.

so i want a notification after the simulation is finished.  maybe a sound alter or send a email, these two computers in the Local Area Network, so i want just do something from one computer to the other.

How to decide when the simulation is done?   when the simulation is on, the cpu usage is more than 80%. But when it finished the simulation, the cpu usage is less than 10%. so i think we can use 30% cpu usage as the condition to judge.

so the powershell have the power in this case? 

i have try to find some simple software to do this work, but i coundn't find. so i think maybe the powershell script or other script can do. thanks for all.
 
 
Post #: 1
 
 RE: the powershell can monitor the cpu? - 6/10/2007 11:49:58 PM   
  SAPIENScripter


Posts: 270
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
You can "write" a beep with a line like this:

write `a

You case use Get-WMIObject to get the CPU load percentage. This is technically the average load over the last minute but it might be sufficient for your purposes:

$cpu=(gwmi win32_processor).loadpercentage

_____________________________

Jeffery Hicks
Windows PowerShell MVP
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com

Follow Me: http://www.twitter.com/JeffHicks

(in reply to sensen9966)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Windows PowerShell >> the powershell can monitor the cpu? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts