首页 > 解决方案 > 詹金斯没有找到PowerShell

问题描述

当我尝试在我的 biuld 中运行 Windows Powershell 命令时出现此错误。我不知道如何将 Powershell.exe 添加到此?这是一个插件,我不知道它的位置或如何使用它。

[DeploymentTest] $ powershell.exe -NonInteractive -ExecutionPolicy ByPass "& '/tmp/jenkins8870821876113230026.ps1'"
FATAL: command execution failed
java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)

. . .

Caused: java.io.IOException: Cannot run program "powershell.exe" (in directory "/var/lib/jenkins/workspace/DeploymentTest"): error=2, No such file or directory

标签: jenkinsjenkins-plugins

解决方案


您正在 Linux 机器上运行它。请切换到 Windows 机器,因为您需要 Windows 来运行 powershell。


推荐阅读