I have the following script that loops through textfiles an replaces the letter a by b
$fileList = Get-ChildItem C:\Projekte\ps
foreach ($i in $fileList){ (Get-Content -Path $i.FullName ) -replace 'a' , 'b' | Set-Content -Path $i.FullName }
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 ".new"
I expected something like
Set-Content -Path $i.FullName + '.new'
but thats obviously wrong.
Whats the right syntax for this problem?