PowerShell – Replace All Instances Of Something In All Files In Directory Writer #1, 2016-03-18 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 $_} Powershell powershellreplace