Created
February 4, 2014 18:46
-
-
Save martinnormark/8809764 to your computer and use it in GitHub Desktop.
Rename file names and replace within multiple files using Powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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