Get-ChildItem "\\myfileserver\files\folder\999\*" | Rename-Item -NewName { ($_.Name-replace '(?<=^[^_]+)_.+?(?=\.)').Replace(".vfmpclmadj.", ".va.").Replace(".VFMP.",".va.") }
The above changes the file name
Before 999_837I.84146.VFMP.000000384.20210127.121415
After 999.84146.va.000000384.20210127.121415
Now I need to remove 20210127.121415
and add the current date and time.
I need help accomplishing that last piece. Thanks.