Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gpsarkar/6ab9ab890fa15d74e76b197121b34d74 to your computer and use it in GitHub Desktop.
Save gpsarkar/6ab9ab890fa15d74e76b197121b34d74 to your computer and use it in GitHub Desktop.
powershell to rename string in files recursive
Get-ChildItem -r -Depth 1 -include "web.config" |
foreach-object { $a = $_.fullname; ( get-content $a ) |
foreach-object { $_ -replace "oldstring","newstring" } |
set-content $a }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment