1

I have a powershell script cloned into my workspace from a bitbucket repository. If I login to the Jenkins server cli I can run it by doing

cd /var/lib/jenkins/workspace/powershell
pwsh
./psscript.ps1

This runs fine as expected, but when I try to run it via Jenkins I get the error

/tmp/jenkins2117772455970634975.sh: line 3: ./psscript.ps1: Permission denied

My Jenkins user is

user.name   netuser

and when I do a whoami from both the pwsh cli console and on the linux cli I get the same thing

PS /var/lib/jenkins/workspace/powershell> whoami

netuser

[netuser@server1]$ whoami
netuser

Is there another setting I'm missing here?

  • Two quick questions? Is it every powershell script or just this one? If it's limited to this script can you share the contents of that script? – casey vega Jul 20 '18 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.