summaryrefslogtreecommitdiff
path: root/build/windows/lib/in-place-regex.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'build/windows/lib/in-place-regex.ps1')
-rw-r--r--build/windows/lib/in-place-regex.ps111
1 files changed, 11 insertions, 0 deletions
diff --git a/build/windows/lib/in-place-regex.ps1 b/build/windows/lib/in-place-regex.ps1
new file mode 100644
index 00000000..7b309342
--- /dev/null
+++ b/build/windows/lib/in-place-regex.ps1
@@ -0,0 +1,11 @@
+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)
+}