I have a series of PDF files on my computer that I am trying to rename them using Powershell by adding a sequential number starting at 1000 to the beginning of, preceded by the letter "B".
Current file naming:
FileNameA.pdf
FileNameB.pdf
FileNameC.pdf
What I want:
B1000 - FileNameA.pdf
B1001 - FilenameB.pdf
B1002 - FileNameC.pdf
I tried using the following function to achieve this:
$count=1000;
dir "C:Temp" | rename-item -newname {"B {0} - {1}" -f $count++, $_.name}
When I do this it renames all of the files with "B 1000" at the beginning but does not sequentially number them. Can someone help me figure out how to modify this code to achieve this?
Thanks!