Are you on a 64bit version of Windows, and if so, did you set the policy using 
both the 32-bit and 64-bit PowerShell exe ? We had a similar error in the past 
because the policy had been manually set from a command line, which used the 
64bit exe, but Jenkins was using the 32bit PowerShell.

32-bit:  C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
64-bit:  C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

-Chris

Chris Williams
Dell | PG Release Engineering

From: jenkinsci-users@googlegroups.com 
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of Steve K
Sent: Friday, June 29, 2012 8:36 AM
To: jenkinsci-users@googlegroups.com
Subject: Unable to exec Powershell on one slave.


Hello,

I have a job that uses Powershell to exec one of the build's build steps.
The job can run, without problem, on either of two Windows XP slaves.
If I attempt to run the job on a Windows 7 slave, I get the following error:
"File C:\Users\lx00057\AppData\Local\Temp\hudson9076101655905735463.ps1 cannot 
be loaded because the execution of scripts is disabled on this system."

I set the ExecutionPolicy on the problematic Windows 7 machine and am able to 
login directly to the machine and successfully execute Powershell scripts.
I have tried setting the ExecutionPolicy to "RemoteSigned", "Unrestricted", and 
"Bypass".
I have tried; restarting the slave service, restarting the Jenkins server, and 
rebooting the Windows 7 machine.

Thanks in advance for your ideas.

Reply via email to