title: How does PowerShell regex work with multi-line strings?
body: <p>Alright, this is driving me nuts because my regex is working on Rubular, but PowerShell is not working as I expect.</p>
  
  <ol>
  <li>I did a Get-ChildItem on a network directory and then directed the output into a txt file. </li>
  <li>I went to remove the directory info from the text file that appears like the following:</li>
  </ol>
  
  <p><img src="https://i.stack.imgur.com/ZpsG7.png" alt="enter image description here"></p>
  
  <ol start="3">
  <li>When I use PowerShell to try and write a regex to remove the Directory info, I run into some problems.</li>
  </ol>
  
  <p>When I use:</p>
  
  <pre><code>$var = Get-Contnet "file path"
  $var -match "Directory.*"
  </code></pre>
  
  <p>PowerShell grabs the text I am looking for, BUT it doesn't grab the text that starts on a new line, I get:</p>
  
  <pre><code>Directory: \\Drive\Unit\Proposals\Names\Location\crazy folder path\even crazier folder path\unbelievable folder path\
  </code></pre>
  
  <p>So... when I use:</p>
  
  <pre><code>$var -match "Directory.*\n.*"
  </code></pre>
  
  <p>I get nothing...</p>
  
  <p>When I try this on Rublar it works fine, what am I missing here? Any help would be great, thanks!</p>