I have multiple .mp3 files in the catalogue and want to remove artist's name from their filenames. All the files' names contain string
"Adhesive Wombat - "
followed by the song's title. I want to remove (not replace) every occurence of that specific string in every filename in current folder.
Not to mention, I've searched for answer on this site and failed to find an elegant and satisfying solution.
This is my first encounter with PowerShell.
Get-ChildItemandRename-Item... maybe you would have to useFor-EachObjectDir | ren -NewName { $_.Name -replace "Adhesive Wombat - ", "" }but there also were filenames that contained no space between words, that is "AdhesiveWombat". I'd like to remove both strings with one clear line of code, instead of executing 2 orders, one for each case.Dir | ren -NewName { $_.Name -replace "Adhesive ?Wombat - ", "" }