View Single Post
Old 12-30-2008   #1 (permalink)
rferrisx


 
 

filter out text..

In this I want to filter out "0 KB" (e.g Those apps whose WS has not
changed in the specified $args [time])...but I am thinking my
construct is not working with objects quite right. Any input is
appreciated.


$then = ps | %{$_ | Select Name, WorkingSet}
sleep $args[0]
$now = ps | %{$_ | Select Name, WorkingSet}
$count = $now.count
$difference = ( 0..$count |
%{"WS diff is" + " " + $Now[$_].Name + " " + ( ( $then
[$_].WorkingSet / 1KB ) - ( $Now[$_].WorkingSet / 1KB ) ) + " " +
"KB"} )
$difference

[output like:]

..\WS_diff.ps1 1200
.....
WS diff is explorer -12 KB
WS diff is GoogleToolbarNotifier 0 KB
WS diff is GoogleUpdate 0 KB
WS diff is GoogleUpdaterService 0 KB
WS diff is gpowershell 0 KB
....
WS diff is powershell -16 KB
My System SpecsSystem Spec