| |
SAPIENScripter
Posts: 270
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
|
In Powershell, you may not need scripts in the same way you did with VBScript. To kill high mem processes all you need is an expression like this: get-process | where {$_.workingset -ge 100MB} | stop-process -confirm You could also check CPU time. If your VBScript scripts work, there shouldn't be any reason to re-invent the wheel. Unless you want to the Powershell experience or want to take advantage of a Powershell feature. In VBScript, there can be a lot of parsing since you're often dealing with text. In Powershell, since you are using objects, pipelining is the trick: get-process | where {$_.workingset -ge 50MB} | select Name,WorkingSet,StartTime | sort Starttime | format-table -auto You might also check the Technet Script Center for Powershell examples.
_____________________________
Jeffery Hicks Windows PowerShell MVP SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com Follow Me: http://www.twitter.com/JeffHicks
|
|