title: Powershell - Select String - Export multiple Lines
body: <p>I´m searching for a <code>string</code> called "Please try again later" in a textfile.</p>
  
  <p>How i can export the line with the match including n lines before the matching line?</p>
  
  <p>Currently I use the following command to extract the matching line.</p>
  
  <pre><code>get-content "File.txt | select-string "Later"
  </code></pre>
  
  <p>Output should be like this (including ------------ if possible)</p>
  
  <pre><code>------
  Sending: 250 &lt;user@domain1.com&gt;
  SMTP Command: R-CPT TO:&lt;user@domain2.com&gt;
  Sending: 451 Please try again later
  ------
  </code></pre>