title: Powershell: Display last X lines of a log that match a criteria and keep watching the file
body: <p>I am trying to watch a log file for occurrences of a word ("Purge"). 
  I want to display the last 10 <em>matching</em> lines (at the time the command runs) and keep watching the file for newly appended lines that match the criteria. </p>
  
  <p>So far, I got <em>something</em> working with PowerShell:</p>
  
  <pre><code>get-content .\CallAudit.Engine.log -tail 10 -Wait | where {$_ -match "Purge"}
  </code></pre>
  
  <p>This works, but it gets the last (any) 10 lines and only then applies the filter. </p>
  
  <p>I want to </p>
  
  <ul>
  <li>get only the <em>matching</em> last 10 lines</li>
  <li>have the command keep watching the file.</li>
  </ul>
  
  <p>Can this be done?</p>