Skip to content

Instantly share code, notes, and snippets.

@martinnormark
Created February 4, 2014 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinnormark/8809764 to your computer and use it in GitHub Desktop.
Save martinnormark/8809764 to your computer and use it in GitHub Desktop.
Rename file names and replace within multiple files using Powershell
ls *.* -rec | %{ $f=$_; (gc $f.PSPath) | %{ $_ -replace "SEARCH", "REPLACEMENT" } | sc $f.PSPath }
Get-ChildItem *.* -rec | Rename-Item -NewName { $_.Name -replace 'SEARCH','REPLACEMENT' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment