
[英]Command works directly in Powershell but doesn't work when executed through a linux system using powershell
[英]Powershell command works manually, but does not work when executed in Jenkins
我有一个奇怪的场景,我的命令手动在 PowerShell 上运行,但在 Jenkins PowerShell 插件上执行时却不行。 我是 PowerShell 和 Jenkins 的新手,我想我缺少一条规则。 我在这里和网上到处找,但我没有找到解决方案。
我创建了一个执行 PowerShell 脚本的作业,该脚本使用自由式项目在我的桌面上打开一个 RDP 文件。 在 Powershell 上执行时,它按预期工作,但在 Jenkins 中,构建成功,但没有打开 RDP。
这是脚本:
Start-Process "$env:windir\system32\mstsc.exe" -ArgumentList "RDP File /h:900 /w:1600" -WindowStyle Minimized
我正在使用 Windows 服务器 2016。
这是我尝试过的:
这真的是 PowerShell 插件的行为吗? 有什么我遗漏的地方吗? 请帮我解决这个问题。
任何人都可能需要这个。 我能够通过 Jenkins PowerShell 插件执行 RDP。
我所做的是 go Jenkins 的 Window 服务 > 登录选项卡 > Select “此帐户”并输入您的用户帐户凭据。
我怀疑这是一个安全问题。 Jenkins 默认使用没有足够权限的“SYSTEM”帐户。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.