title: Use a string variable as input for Set-Content -Path
body: <p>I have the following script that loops through textfiles an replaces the letter a by b</p>
  <blockquote>
  <p>$fileList = Get-ChildItem  C:\Projekte\ps</p>
  <p>foreach ($i in $fileList){ (Get-Content -Path $i.FullName ) -replace 'a' , 'b'    | Set-Content -Path  $i.FullName  }</p>
  </blockquote>
  <p>I works, and the result is written back to the original files. I need to write the content back to a new file. The name of the file is the original file but wit the extension &quot;.new&quot;</p>
  <p>I expected something like</p>
  <blockquote>
  <p>Set-Content -Path  $i.FullName + '.new'</p>
  </blockquote>
  <p>but thats obviously wrong.</p>
  <p>Whats the right syntax for this problem?</p>