Posted By

michanne on 12/16/10


Tagged

String PowerShell


Versions (?)

Searches for a string in file and returns the lines per array


 / Published in: Windows PowerShell
 

  1. Select-string $file -pattern 'TOTALS:' | select -first 3 |foreach {(get-content $file -totalcount ($_\3.linenumber +4))[-5,-3,-1]}

Report this snippet  

You need to login to post a comment.