title: Get the line number of last occurrence of a particular string with [Linq.Enumerable] in PowerShell
body: <p>Is there a way to get the line index of the last occurrence in file, not the line itself?</p>
  <pre><code>$delegate = [Func[string,bool]] {$args[0] -match $myString}
  $lastCheckIn  = [Linq.Enumerable]::Last([System.IO.File]::ReadLines($myFile), $delegate)
  </code></pre>
  <p>I thought of using <code>[Linq.Enumerable]::Count</code> but couldn't find a method to return a sequence from the start to <code>$lastCheckIn</code>.</p>