【发布时间】:2011-03-26 08:27:17
【问题描述】:
使用 Powershell 插件从 Hudson CI 服务器执行 Powershell 脚本时遇到问题。我在跑步:
- 哈德森 v1.362
- Windows 2003
- Powershell 1.0
我正在尝试为 Hudson 使用 Powershell 插件。我尝试的任何东西都会给我:
File C:\DOCUME~1\SVC_PR~1\LOCALS~1\Temp\hudson2144883754471568213.ps1
cannot be loaded because the execution of scripts is disabled on this system.
我已将ExecutionPolicy 设置为“Unrestricted”,但我仍然在 Hudson 收到相同的消息。
- 尝试重新启动 Hudson - 没有解决问题。
- 尝试将“
Set-ExecutionPolicy Unrestricted”放入运行 Hudson 的帐户的 Powershell 配置文件中,但只成功地两次而不是一次向我提供了上述消息(哦,具有讽刺意味) - 尝试从命令行“
Powershell -ExecutionPolicy Unrestricted”发出。
返回的错误:“Missing expression after unary operator '-'. At line:1 char:2 + -ExecutionPolicy Unrestricted” - 我假设是因为我使用的是 Powershell 1 而-ExecutionPolicy不是 v1 选项。
所以我被困住了。任何关于如何让 Hudson 使用这个 Poweshell 插件运行 Powershell 脚本的建议都将受到欢迎。
谢谢
杰米
【问题讨论】:
标签: powershell hudson