Jenkins Execute Windows batch command fails for file change -
i trying change text in config file using jenkins windows batch command giving following error.
(get-content config_qa.properties ) | {$_ -replace "test123", "test"} | set-content config_qa.properties
ran above in jenkins windows batch command. below error message.
'{$_' not recognized internal or external command, operable program or batch file. build step 'execute windows batch command' marked build failure [workspace] $ cmd /c call c:\windows\temp\hudson2235664364282200461.bat
thanks
are sure didn't miss operator (after first pipe)? like:
(get-content config_qa.properties ) | {$_ -replace "test123", "test"} | set-content config_qa.properties
edit: also, need make sure jenkins trying run in powershell, not windows batch (default)
Comments
Post a Comment