Forum Discussion
John_Dodo
Jul 13, 2022Brass Contributor
Rename file using Regex
Hello, I need to bulk rename files usgin regex. I'm very bad with regex 😕 Here is a simplified sample: ...
$source = "blabla"
$target = "blibli"
$files = Get-ChildItem -file -path ".\D...
LainRobertson
Jul 13, 2022Silver Contributor
Here's an ultra-simple example.
Strictly speaking, if you are replacing a contiguous text block, using a string's .Replace() method would be faster but let's not get distracted with that, since working with the file system means you won't realise any performance benefit from going down that path.
Cheers,
Lain