The problem is I need to rename files.
Original name:
Patient Data - John Smith - John Varner
I have tried this code:
Get-ChildItem -Recurse |
Rename-Item -NewName { $_.Name -replace "John ","Dr. " }
But the problem is it also replaces the other name to Dr. that looks like this:
Patient Data - Dr. Smith - Dr. Varner
But I need it to look like this:
Patient Data - Dr. Smith - John Varner
Oh just to let you know I'm a noob when it comes to Powershell I just copy codes from the internet. So I dont have any idea what code to use. Please help me with the exact code I'm gonna use. Thank you so much