Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Replace a portion of a filename in a list of filenames with regex.
ls * -name | ren -newname {$_ -replace '^(.*)-replaceme-(.*)$', '$1-newvalue-$2'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment