Jenkins:通过SSHCommand运行带有NOHUP的PowerShell脚本

发布于 2025-02-10 20:13:48 字数 365 浏览 1 评论 0原文

我通过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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文