I need to replace multiple strings in multiple filenames. Here's something representative of what my data looks like.
CAL aB12 AUG.docx CAL cDe345 AUG.docx CAL FGHiJKL6789 AUG.docx
I need to replace "CAL" with "Calendar" and "AUG" with "August" in the filenames.
The best I've been able to do is run two cmdlets (one for each replacement) chained together with a semicolon. This works, but I know it's crude.
gci | Rename-Item -NewName { $_ -replace "CAL", "Calendar" };
gci | Rename-Item -NewName { $_ -replace "AUG", "August" }
After extensive searching, I found StackOverflow 3403217. Due to a lack of knowledge and experience I haven't been able (and I've tried hard) to translate any of the five answers it provides into a single cmdlet that works for what it is that I'm trying to do.
p.s. I paste copies of the files of interest into C:\Temp and work from there. I'm using Windows 7.