Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hudson won't run any Powershell scripts using Powershell plugin

Encountered a problem executing Powershell scripts from Hudson CI server using the Powershell Plugin. I'm running:

  • Hudson v1.362
  • Windows 2003
  • Powershell 1.0

I am trying to use the Powershell plugin for Hudson. Anything I try just gives me:


File C:\DOCUME~1\SVC_PR~1\LOCALS~1\Temp\hudson2144883754471568213.ps1  
  cannot be loaded because the execution of scripts is disabled on this system.

I have set the ExecutionPolicy as "Unrestricted" but still I get the same message in Hudson.

  1. Tried restarting Hudson - didn't solve it.
  2. Tried putting "Set-ExecutionPolicy Unrestricted" in the Powershell profile of the account running Hudson, that only succeeded in giving me the above message twice instead of once (oh the irony)
  3. Tried issuing from the command-line "Powershell -ExecutionPolicy Unrestricted".
    That returned error: "Missing expression after unary operator '-'. At line:1 char:2 + -ExecutionPolicy Unrestricted" - I assume because I am using Powershell 1 and -ExecutionPolicy is not a v1 option.

So I'm stuck. Any advice as to how to get Hudson to run Powershell scripts using this Poweshell plugin would be most welcome.

Thanks

Jamie

like image 427
jamiet Avatar asked Mar 09 '26 18:03

jamiet


1 Answers

Good news. Installing Powershell v2 seems to have solved the problem. I'm not 100% sure all problems have gone away but I can successfully execute Powershell commands using the Powershell plugin for Hudson and that is good news.

Thanks to all for the help and I hope this thread proves useful to folks in the future.

Regards Jamie

like image 127
jamiet Avatar answered Mar 12 '26 10:03

jamiet