Pokúšam sa zmeniť text v konfiguračnom súbore pomocou príkazu Jenkins Windows batch, ale jeho nasledujúcu chybu.
(Get-Content config_qa.properties ) | {$_ -replace "test123", "test"} | Set-Content config_qa.properties
Spustilo vyššie uvedené v okne jenkins windows batch command. nižšie je chybové hlásenie.
"{$_" 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:windowsTEMPhudson2235664364282200461.bat
Vďaka
odpovede:
0 pre odpoveď č. 1Ste si istý, že ste nezmeškali operátor WHERE (po prvom potrubí)? Páči sa mi to:
(Get-Content config_qa.properties ) | where {$_ -replace "test123", "test"} | Set-Content config_qa.properties
EDIT: Tiež je potrebné sa uistiť, že sa Jenkins pokúša spustiť túto funkciu v PowerShell, nie v systéme Windows (štandardne)