12 lines
373 B
PowerShell
12 lines
373 B
PowerShell
|
function In-Place-Regex {
|
|||
|
param (
|
|||
|
[Parameter(Mandatory)][string]$Path,
|
|||
|
[Parameter(Mandatory)][string]$Search,
|
|||
|
[Parameter(Mandatory)][string]$Replace
|
|||
|
)
|
|||
|
|
|||
|
$content = (Get-Content "$Path" -Encoding UTF8)
|
|||
|
$content = ($content -replace "$Search", "$Replace")
|
|||
|
[System.IO.File]::WriteAllLines((Get-Item "$Path").FullName, $content)
|
|||
|
}
|