From dcda0b012b5da1868879fb2e19b0d5f07d780631 Mon Sep 17 00:00:00 2001 From: Catfriend1 <16361913+Catfriend1@users.noreply.github.com> Date: Wed, 15 Sep 2021 10:23:00 +0200 Subject: [PATCH] Create psreplace.cmd --- psreplace.cmd | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 psreplace.cmd diff --git a/psreplace.cmd b/psreplace.cmd new file mode 100644 index 000000000..f3b16609d --- /dev/null +++ b/psreplace.cmd @@ -0,0 +1,18 @@ +@echo off +REM +REM Version 1.0 +REM +SET TMP_PSR_SEARCH=%1 +IF DEFINED TMP_PSR_SEARCH SET "TMP_PSR_SEARCH=%TMP_PSR_SEARCH:"=%" +IF DEFINED TMP_PSR_SEARCH SET "TMP_PSR_SEARCH=%TMP_PSR_SEARCH:`=""%" +REM +SET TMP_PSR_REPLACE=%2 +IF DEFINED TMP_PSR_REPLACE SET "TMP_PSR_REPLACE=%TMP_PSR_REPLACE:"=%" +IF DEFINED TMP_PSR_REPLACE SET "TMP_PSR_REPLACE=%TMP_PSR_REPLACE:`=\"%" +REM +SET TMP_PSR_TARGET_FULLFN=%3 +IF NOT DEFINED TMP_PSR_TARGET_FULLFN powershell -NoLogo -NoProfile -ExecutionPolicy ByPass -Command "Write-Host -NoNewLine ((($Input | Out-String) -Replace '%TMP_PSR_SEARCH%', '%TMP_PSR_REPLACE%') -Replace '§n', \"`n\" -Replace '§r', \"`r\")" 2> NUL: & goto :eof +REM +powershell -NoLogo -NoProfile -ExecutionPolicy ByPass -Command "Set-Content -Path '%3' -NoNewLine -Value ((($Input | Out-String) -Replace '%TMP_PSR_SEARCH%', '%TMP_PSR_REPLACE%') -Replace '§n', \"`n\" -Replace '§r', \"`r\")" +REM +goto :eof