我的一個工作需要ConvertTo-Json
commandlet在我們的Windows Server 2008 R2(SP1)框上powershell 3.0因此I installed WMF 3.0。重新啓動後,所有使用我的PowerShell的工作導致錯誤:Hudson在更新到powershell 3後無法找到powershell
[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
運行從命令提示符的作品就好了powershell.exe
。
發生了什麼事?我該如何解決?
我使用PowerShell的插件啓動腳本,我找不到它的任何配置區域。
也許嘗試[PowerShell的插件(https://wiki.jenkins-ci.org/display/JENKINS/PowerShell+Plugin)。 –
對不起@AndyArismendi我的問題沒有說清楚 - 我使用PowerShell插件。 –
這個工作本身嗎? 'powershell.exe 「& 'C:\用戶\ HUDSON〜1個\應用程序數據\本地\ TEMP \ hudson1263303013566726397.ps1'」 @AndyArismendi生成該文件(然後擦除)' –