jaxstorm
asked on
Memory Mangement Powershell Script
I need a script to do the following:
• List any processes running on a machine over 100 meg of ram but under 200 meg
o Show the name of process
o Colour them orange
o Using a for or foreach loop
• List any processes running on your machine over 200 meg
o Show the name of the process, company, product and path
o Colour these red
o Using the “where” pipeline command
• Display a set of totals after displaying these two lists
o Total processes running
o Total “orange” processes
o Total “red” processes
I know I need to use the get-process cmdlet like so:
$a = Get-Process | Where-Object {$_.WS -gt 100000000} | where-object {$_.WS -lt 200000000} | sort-object ProcessName | format-table -property ProcessName
and bang them into an array as well as format them with write-output, but I'm not sure how!
• List any processes running on a machine over 100 meg of ram but under 200 meg
o Show the name of process
o Colour them orange
o Using a for or foreach loop
• List any processes running on your machine over 200 meg
o Show the name of the process, company, product and path
o Colour these red
o Using the “where” pipeline command
• Display a set of totals after displaying these two lists
o Total processes running
o Total “orange” processes
o Total “red” processes
I know I need to use the get-process cmdlet like so:
$a = Get-Process | Where-Object {$_.WS -gt 100000000} | where-object {$_.WS -lt 200000000} | sort-object ProcessName | format-table -property ProcessName
and bang them into an array as well as format them with write-output, but I'm not sure how!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.