I restored a large number of files in diverse folders from a hard drive, and they all included a string.
I removed this string in windows powershell using
get-childItem -recurse | Where {$_.name -like "*(2025_09_29 13_23_14 UTC)*"} | rename-item -newname { $_.name -replace "(2025_09_29 13_23_14 UTC)","" }
but was left with all files now being named filename().file. I can't remove the "()" with the same script for some reason.
get-childItem -recurse | Where {$_.name -like "*()*"} | rename-item -newname { $_.name -replace "()","" }
This command does not change my file names, and I'd really like to get rid of this remaining () string. Does anyone know what is going on here?
-replace "\(\)"
. You need to escape parentheses when using regex and the escape character is\