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


/ Published in: Windows PowerShell
Save to your folder(s)



Copy this code and paste it in your HTML
  1. Select-string $file -pattern 'TOTALS:' | select -first 3 |foreach {(get-content $file -totalcount ($_.linenumber +4))[-5,-3,-1]}

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.