title: Powershell: search backwards from end of file
body: <p>My script reads a log file once a minute and selects (and acts upon) the lines where the timestamp begins with the previous minute.</p>
  
  <p>This is easy (the regex is simply "^$timestamp"), but when the log gets big it can take a while.</p>
  
  <p>My thinking is the lines I want will always be near the bottom of the file, so I'd be searching far fewer lines if I started at the bottom and searched upwards, stopping when I get to the minute prior to the one I'm interested in.</p>
  
  <p>My question is, how can I search from the bottom of the file instead of the top?  Can I even say "read line $length", or even "read line n" (if so I could do a sort of binary search thing to find the length of the file and work backwards from there)?</p>
  
  <p>Last question: would this even be faster (I'd still like to know how to do it even if it wouldn't be faster)?</p>
  
  <p>Ideally, I'd like to do this all in my own code without installing anything extra.</p>
  
  <p>Thanks</p>