Issue
I'm getting this error when I tried to run a Windows Powershell command in my biuld. I don't know how to add Powershell.exe to this? This was a plugin and I have no idea where it's located or how to use it.
[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
Solution
You are running it on a Linux box.Please switch over to a Windows box as you need Windows to run powershell.
Answered By - Ravindranath Barathy
Answer Checked By - Willingham (JavaFixing Volunteer)