Automated File Renaming based on Creation Date

Job ID: 38151000

Budget: $25 – $50 USD

I need to rename a larger number of .jpg and .mp4 files based on their creation dates.

Specifically, I need the new file names to follow this:
$newName = "{0}-{1}-{2} {3}.{4}.{5} ({6}){7}" -f $year, $month, $day, $hour, $minute, $second, $counter, $file.Extension
Example: 2024-12-01 11.14.04-1.jpg

I already have a script, but there is an error in the code and it fails.
Files can be overwritten or stored in a new folder.

Windows-based solution.
It just needs to run once, so code for use in Poweshell or similar would be fine.