Hey PowerShell Guy! How Can I Replace Incorrect Dates in My File Names?
No solutions to post today , so time for a small Hey scripting guy ! translation : How Can I Replace Incorrect Dates in My File Names?
dir *.jpg | ren -new {$_.name -replace "(\d{1,2})-(\d{1,2})-07",'$1-$2-08' }
To keep the example clear I used exactly the same regex as the scripting guy did.
this is a typical example how powerfull scriptblock parameters are in PowerShell, combined with the -replace operators regex support in PowerShell.
for a more complete explanation see this post on my former blog : /\/\o\/\/ PowerShelled: PowerShell : Advanced renaming of files where I cover advanced renaming of files in PowerShell this way in much more detail.
Enjoy,
Greetings /\/\o\/\/