title: How does powershell lazily evaluate this statement?
body: <p>I was searching for a way to to read only the first few lines of a csv file and came across <a href="https://stackoverflow.com/questions/28908638/extract-only-the-first-10-lines-of-a-csv-file-in-powershell">this answer</a>. The accepted answer suggests using</p>
  <pre><code>Get-Content &quot;C:\start.csv&quot; | select -First 10 | Out-File &quot;C:\stop.csv&quot;
  </code></pre>
  <p>Another answers suggests using</p>
  <pre><code>Get-Content C:\Temp\Test.csv -TotalCount 3
  </code></pre>
  <p>Because my csv is fairly large I went with the second option. It worked fine. Out of curiosity I decided to try the first option assuming I could <code>ctrl+c</code> if it took forever. I was surprised to see that it returned just as quickly.</p>
  <p>Is it safe to use the first approach when working with large files? How does powershell achieve this?</p>