Get-Help Rename-Item
-Path <string>
Accept pipeline input? true (ByValue, ByPropertyName)
In this situation the value supplied for a parameter in the next command in the pipeline must be described by a script block. The script block will be invoked for each iteration of the output pipeline.New-Item C:\Temp\TestSet -ItemType Directory -Force
1..10 | ForEach-Object { New-Item "C:\Temp\TestSet\$_.txt" }
Get-ChildItem C:\Temp\TestSet -Filter *.txt | Rename-Item -NewName { "$($_.Name).new.txt" }
There is no problem with the answer I've given above.