SSH服务器为Window10(安装OpenSSH)

在Publish Over SSH Plugin插件里执行命令时,只能执行第一句

例如:

dir
dir

只有第一句命令会打印出来

正确写法

cmd /c "dir & dir"

官方网站issues下找到了解决方法

https://issues.jenkins-ci.org/browse/JENKINS-17809

The solution is to add "cmd /c" before of the command.

Por example, you could to write in the section "Exec command" of the Publish Over SSH Plugin:

cmd /c mkdir "D:\MyFolder\"

Also, if you want to run multiples commands, you could write something like the following statement:

cmd /c "echo Hello & echo My Friend"

On the other hand, is better execute a file batch with the lines to execute:

cmd /c "C:\data\scripts\myScript.bat"

 

Window安装OpenSSH

参考:https://www.cnblogs.com/SmilingEye/p/12100934.html

相关文章:

  • 2022-12-23
  • 2021-12-25
  • 2021-08-28
  • 2021-09-25
  • 2022-12-23
  • 2021-10-19
  • 2021-10-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2021-09-15
  • 2021-11-14
相关资源
相似解决方案