Executiing powershell script in Jenkins 2.0 pipeline not allowed.

238 views
Skip to first unread message

Jan-Olav Eide

unread,
Sep 15, 2016, 7:14:26 AM9/15/16
to Jenkins Users
I have a powershell script I want to execute in a pipeline step.
I thus call :

 bat 'powershell \\tmp\\test.ps1'

prior to this I have set the ExecutionPolicy to Unrestricted as admin.

Still, when the pipeline runs, I get this

13:07:13 C:\Program Files (x86)\Jenkins\workspace\Merchant Pipeline\trunk>powershell \tmp\test.ps1 
13:07:13 File \tmp\test.ps1 cannot be loaded because the execution of scripts is disable
13:07:13 d on this system. Please see "get-help about_signing" for more details.

Why doesn't triggering the excution of powershell via the 'bat' operation respect the Unrestricted execution policy I just set ?


 

Baptiste Mathus

unread,
Sep 19, 2016, 2:36:54 PM9/19/16
to jenkins...@googlegroups.com
I don't Windows admin much, but did you make sure Jenkins is running under the user you've granted perms? Also, did you restart Jenkins so that that new permissions apply?

My 2 cents

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/4a004aee-5588-446a-a6e9-9dec21a0cee2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages