title: Powershell recursive search to chose .txt files then output contents of all files into a single .txt file
body: <p>Any help greatly appreciated.</p>
  
  <p>I have a folder that contains 30+ folders which each have a .txt file that I can search for using:</p>
  
  <blockquote>
    <p>Get-ChildItem -Filter *.txt -Recurse</p>
  </blockquote>
  
  <p>I want to read the contents of each .txt file discovered and output the contents int a new .csv file on my desktop that also includes the directory of each .txt file contents being displayed.</p>
  
  <p>The question is twofold, </p>
  
  <ol>
  <li><p>how to use pipe and powershell commands to read/show all the words in the files.</p></li>
  <li><p>how to create the csv data that will output both the directory name and the contents of the .txt files.</p></li>
  </ol>
  
  <p>I can already pipe results to: </p>
  
  <blockquote>
    <p>c:\desktop\test.csv -Encoding ascii -noTypeInformation</p>
  </blockquote>