tag:blogger.com,1999:blog-37819735.post116523375537656798..comments2023-11-02T16:16:25.855+01:00Comments on JBs Powershell: OnelinerJakob Bindslethttp://www.blogger.com/profile/15991115017499294057noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-37819735.post-1165550450796337442006-12-08T05:00:00.000+01:002006-12-08T05:00:00.000+01:00BTW - you can pipe to foreach and it can take 3 s...BTW - you can pipe to foreach and it can take 3 scriptblocks. One gets called before any object, the middle one gets called for each object, the last one gets called after all objects are processed. Thus you can do this:<BR/>PS> gps |foreach {$sum=0} {$sum += $_.workingset} {[int]($sum/1mb)<BR/>1091<BR/><BR/>Enjoy<BR/>Jeffrey Snover [MSFT]<BR/>Windows PowerShell/MMC Architect<BR/>Visit the Anonymousnoreply@blogger.com