title: Powershell - Append file name, find & replace, output to directory
body: <p>I have a few automated tasks that I would like to to a directory of txt files on a daily basis. This includes:</p>
  
  <p>1.Append the file name to the first row of the txt file</p>
  
  <p>2.Replace the tab delimited content with semi-colons (find &amp; replace)</p>
  
  <p>3.Save the files to a sub-directory </p>
  
  <p>The following code works to do the find &amp; replace, but I am not able to save the output to a different directory, it instead overwrites the original file. Is there a different command that will allow me to save the output to a different directory? </p>
  
  <pre><code>(Get-Content "C:\Input\*.txt") -replace "`t", ";" | Set-Content "C:\Input\*.txt"
  </code></pre>
  
  <p>I currently have a BAT that does item 1 (append file name), but if that can be wrapped into the Powershell script I think it would be a cleaner way of doing things. Any help appreciated!</p>