Hi I have had a look around and am unable to find a solution to my issue (which I am surprised by as it seems so simple, so apologies if it has been answered elsewhere, I couldn’t find it).
I am attempting to do do a bulk rename of all .pdf files in a directory. filenames for example:
11-1000-E1754A-SCH-5001 WIP LOAD SCHEDULE.pdf
11-1000-E1754A-SCH-5002 WIP INSTRUMENT SCHEDULE.pdf
11-1000-E1754A-SCH-5003 WIP CABLE SCHEDULE.pdf
I am using the following line in Powershell:
Get-ChildItem *.pdf | Rename-Item -NewName {$_.Name -replace 'WIP*','0A.pdf'}
What I am expecting to happen is all renamed to the following:
11-1000-E1754A-SCH-5001 0A.pdf
11-1000-E1754A-SCH-5002 0A.pdf
11-1000-E1754A-SCH-5003 0A.pdf
but the wildcard in the rename statement is not picking up the trailing string after the ‘WIP*’ part of the filename.
What I actually get is this:
11-1000-E1754A-SCH-5001 0A.pdf LOAD SCHEDULE.pdf
11-1000-E1754A-SCH-5002 0A.pdf INSTRUMENT SCHEDULE.pdf
11-1000-E1754A-SCH-5003 0A.pdf CABLE SCHEDULE.pdf
any ideas where I am going wrong? or a better way of achieving what I am after?
TIA.