Jenkins Execute Windows batch command fails for file change


Hi all,
I am new Jenkins, I am trying to change text in a config file using Jenkins Windows batch command but its giving the following error.

(Get-Content )  | {$_ -replace "test123", "test"}   | Set-Content 

Ran the above in jenkins windows batch command. below is the error message.

'{$_' is not recognized as an internal or external command,
operable program or batch file.
Build step 'Execute Windows batch command' marked build as failure
[workspace] $ cmd /c call C:\windows\TEMP\hudson2235664364282200461.bat



Did not compute…


I think you’re looking for stack overflow bro.


Execute Windows batch command from jenkins to follow this article :- Jenkins installation on windows look example for more details.