PowerShell

PowerShell function to replace a string in a given text file

0

function Replace-StringInFile { param( [System.String]$file, [System.String]$searchString, [System.String]$replaceString ) [System.IO.File]::WriteAllText($file, [System.IO.File]::ReadAllText($file).Replace($searchString, $replaceString)) } Function usage: Replace-StringInFile…

1 2 3 4 5 7