更新到Powershell 3后,Hudson找不到Powershell [英] Hudson cannot find powershell after update to powershell 3

查看:191
本文介绍了更新到Powershell 3后,Hudson找不到Powershell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作之一是需要 powershell 3.0中可用的ConvertTo-Json命令集因此我在我们的计算机上安装了WMF 3.0 Windows Server 2008 R2(SP1)框.重新启动后,所有使用作业的Powershell都会导致错误:

One of my jobs had need for the ConvertTo-Json commandlet available in powershell 3.0 So I installed WMF 3.0 on our Windows Server 2008 R2 (SP1) box. After a restart all my powershell using jobs result in the error:

[workspace] $ powershell.exe "& 'C:\Users\HUDSON~1\AppData\Local\Temp\hudson1263303013566726397.ps1'"
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: Cannot run program "powershell.exe" (in directory "C:\hudson\jobs\MyProject\workspace"): CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    at hudson.Proc$LocalProc.<init>(Proc.java:192)
    at hudson.Proc$LocalProc.<init>(Proc.java:164)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:639)
    at hudson.Launcher$ProcStarter.start(Launcher.java:274)
    at hudson.Launcher$ProcStarter.join(Launcher.java:281)
    at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:84)
    at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:60)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:630)
    at hudson.model.Build$RunnerImpl.build(Build.java:175)
    at hudson.model.Build$RunnerImpl.doRun(Build.java:137)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:429)
    at hudson.model.Run.run(Run.java:1366)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:145)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:188)
    at java.lang.ProcessImpl.start(ProcessImpl.java:132)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1021)
    ... 16 more

在cmd提示符下运行powershell.exe效果很好.

Running powershell.exe from the cmd prompt works just fine.

发生了什么事?我该如何解决?

What happened? How do I fix this?

我正在使用Powershell插件启动脚本,但找不到任何配置区域.

I am using the Powershell Plugin to launch the scripts and I cannot find any configuration area for it.

推荐答案

经过一整天的麻烦,我们找到了答案.我们仍然不确定到底为什么会发生,但是powershell目录从Hudson的路径中消失了.然后,尽管安装了PS3并重新启动了计算机,但由于某种原因,Hudson并未选择新的PATH变量.

After a day's worth of hassle we found the answer. We're still not sure exactly why it happened but the powershell directory disappeared from Hudson's path. Then, although PS3 was installed and the machine had been restarted, Hudson for some reason had not picked up the new PATH variable.

手动关闭并重新启动Hudson最终使它能够选择正确的PATH并解决了该问题.

Manually shutting down and restarting Hudson finally got it to pick up the correct PATH and fixed the issue.

这篇关于更新到Powershell 3后,Hudson找不到Powershell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆