Skip to content

Instantly share code, notes, and snippets.

@Fireforge
Created December 22, 2019 03:17
Show Gist options
  • Save Fireforge/a45d7ab0f21b982b099f28216b179d86 to your computer and use it in GitHub Desktop.
Save Fireforge/a45d7ab0f21b982b099f28216b179d86 to your computer and use it in GitHub Desktop.
Powershell batch find-replace in file names
# Replace the sub-string "foo" with "bar" in a bunch of files with different file names:
ls | %{ $new = $_ -replace "foo", "bar"; echo $new; mv $_ $new }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment