I have multiple files named like this "firstname_lastname_48.jpg"
I need them to be renamed to look like this "firstname lastname.jpg"
I can remove the numbers using Dir | Rename-Item –NewName { $_.name –replace "[0-9]","" }
I can replace the underscores with a space using this Dir | Rename-Item –NewName { $_.name –replace "_","" }
My problem is that second underscore gets replaced with a space and I haven't been able to figure out how to remove that second space or how to simply remove the second underscore while replacing the first one with a space.
Thanks for any help.