title: Powershell - How do I extract the first line of all text files in a directory into a single output file?
body: <p>I have a directory with about 10'000 text files of varying lengths. All over 1GB in size.</p>
  
  <p>I need to extract the first line of each file and insert it into a new text file in the same directory.</p>
  
  <p>I've tried the usual MS-DOS batch file method, and it crashes due to the files being too large.</p>
  
  <p>Is there a way of doing this in Powershell using Streamreader?</p>