0
I have a filename "+1.txt" that I wish to rename to "+2.txt"
My Powershell script is:
$old = "\+1"
$new = "\+2"
Get-ChildItem | Rename-Item -NewName {$_.name -replace $old, $new }
This returns:
powershell : Rename-Item : Cannot rename the specified target, because it represents a path
How can I correct this?
The backslash in the string is the problem on Windows that's a character found in a path and it's not possible to have it in the name of a filename – Ramhound – 2017-03-18T07:42:13.740