PowerShell - Replace All Instances Of Something In All Files In Directory

ben himself's picture
This script searches every file in a directory for a particular string and replaces it with another value.
get-childItem  | ForEach { (Get-Content $_ | ForEach {$_ -replace "OLDVALUE,"NEWVALUE"}) | Set-Content $_}

Tags: 

Categories: