In our environment we are looking to a Powershell Execution Policy of AllSigned, when running Octopus with this set by GPO I get the following error
2013-09-24 15:29:30 INFO Calling PowerShell script: 'D:\Octopus\Applications\gta Auto POC\EWClientBinaries\17.37.0-alpha02_1\PreDeploy.ps1’
2013-09-24 15:29:36 INFO Unable to modify the execution policy.
2013-09-24 15:29:56 INFO ERROR: & : File D:\Octopus\Applications\gta Auto POC\EWClientBinaries\17.37.0-alpha02_1\PreDeploy.ps1 cannot be loaded because you have elected to not run this software now.
2013-09-24 15:29:56 INFO ERROR: At line:1 char:3
2013-09-24 15:29:56 INFO ERROR: + & 'D:\Octopus\Applications\gta Auto POC\EWClientBinaries\17.37.0-alpha02_1\PreDe …
2013-09-24 15:29:56 INFO ERROR: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2013-09-24 15:29:56 INFO ERROR: + CategoryInfo : SecurityError: ( [], PSSecurityException
2013-09-24 15:29:56 INFO ERROR: + FullyQualifiedErrorId : UnauthorizedAccess
2013-09-24 15:29:57 DEBUG Script ‘D:\Octopus\Applications\gta Auto POC\EWClientBinaries\17.37.0-alpha02_1\PreDeploy.ps1’ completed with return code -12.
2013-09-24 15:29:57 ERROR Octopus.Tentacle.Deployment.Integration.PowerShell.ScriptFailureException: PowerShell script ‘D:\Octopus\Applications\gta Auto POC\EWClientBinaries\17.37.0-alpha02_1\PreDeploy.ps1’ returned non-zero exit code: -12. Deployment terminated.
at Octopus.Tentacle.Deployment.Conventions.PowerShellConvention.RunScript(String scriptName, ConventionContext context) in c:\w\e6923628be6eaf72\source\Octopus.Tentacle\Deployment\Conventions\PowerShellConvention.cs:line 22
at Octopus.Tentacle.Deployment.Conventions.PowerShellPreDeployScript.Install(ConventionContext context) in c:\w\e6923628be6eaf72\source\Octopus.Tentacle\Deployment\Conventions\PowerShellPreDeployScript.cs:line 15
at Octopus.Tentacle.Deployment.DeploymentController.RunInstallConventions(ConventionContext context) in c:\w\e6923628be6eaf72\source\Octopus.Tentacle\Deployment\DeploymentController.cs:line 122
at Octopus.Tentacle.Deployment.DeploymentController.Execute(PackageMetadata package, VariableDictionary variables, IActivityLog log) in c:\w\e6923628be6eaf72\source\Octopus.Tentacle\Deployment\DeploymentController.cs:line 64
2013-09-24 15:29:57 ERROR Running rollback conventions…
2013-09-24 15:29:57 DEBUG Conventions will be run in the following order:
2013-09-24 15:29:57 DEBUG - PowerShellDeployFailedScript
2013-09-24 15:29:57 DEBUG Looking for PowerShell scripts named DeployFailed.ps1
2013-09-24 15:29:57 INFO Calling PowerShell script: 'D:\Octopus\Applications\gta Auto POC\EWClientBinaries\17.37.0-alpha02_1\DeployFailed.ps1’
2013-09-24 15:30:03 INFO Unable to modify the execution policy.
2013-09-24 15:30:05 INFO ERROR: & : File D:\Octopus\Applications\gta Auto POC\EWClientBinaries\17.37.0-alpha02_1\DeployFailed.ps1 cannot be loaded because you have elected to not run this software now.
I understand a fix was rolled out to deal with the Execution Policy being set by GPO but that was when running Remote Signed rather than Allsigned. Can you please advise how to deal with this new error and if you need anything else.
Thnaks
Sam