Hello everyone,
I am working on trying to rename a bunch of files that will generally always have an underscore and a number (exp: net_text_doc_01.pdf)
What I am trying to do is create a powershell script to remove everything from the underscore to the period so all you would have left is net_text_doc.pdf. I have gotten this far with PS:
dir renaming | Rename-Item -NewName {$_.name -replace "_\d",""}
It works like you would think, but if the file has any other underscores followed by a number is removed.
Any thoughts on how i can get the end results i am looking for? I am still fairly new when it comes to powershell so any and all help would be appreciated.