Jenkins:通过SSHCommand运行带有NOHUP的PowerShell脚本
我通过sshcommand
运行powershell脚本,该脚本本身运行了几个在不同端口上侦听的服务器:
sshCommand remote: remote_server, command: " powershell.exe C:/run_services.ps1"
它可以毫无问题地运行服务,我可以在远程服务器上看到它们,但是只要<<<代码> sshcommand 会话已关闭所有服务(流程)终止。
如何像Linux中的nohup
一样运行脚本以使它们运行? 我知道每次都可以编写和启动 /停止Windows服务,但是此解决方案似乎太过时间 /精力消耗了。
I run a powershell script via sshcommand
, the script itself runs several servers that listen on different ports:
sshCommand remote: remote_server, command: " powershell.exe C:/run_services.ps1"
It runs services one by one with no problem, I can see them on remote server, but as soon as sshcommand
session is closed all services(processes) get terminated.
How can I run the script like nohup
in linux to have them running?
I know a windows service can be written and started /stopped every time, but this solution seems way too time/effort consuming.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论