We are randomly receiving an access is denied when attempting to execute powershell.exe. There hasn’t been any observed consistency in the product or step, just that it happens with powershell.exe.
Deploying package: D:\Octopus\Files<product>@@.nupkg
May 15th 2019 12:06:48
Info
Transforming ‘D:\Octopus\Applications\Release<product><version>\Web.config’ using ‘D:\Octopus\Applications\Release<product><version>\Web.Release.config’.
May 15th 2019 12:06:49
Error
System.Exception: Error when attempting to execute C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe: Access is denied —> System.ComponentModel.Win32Exception: Access is denied
May 15th 2019 12:06:49
Error
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
May 15th 2019 12:06:49
Error
at Calamari.Integration.Processes.SilentProcessRunner.ExecuteCommand(String executable, String arguments, String workingDirectory, Dictionary2 environmentVars, String userName, SecureString password, Action
1 output, Action`1 error)
May 15th 2019 12:06:49
Error
— End of inner exception stack trace —
May 15th 2019 12:06:49
Error
at Calamari.Integration.Processes.SilentProcessRunner.ExecuteCommand(String executable, String arguments, String workingDirectory, Dictionary2 environmentVars, String userName, SecureString password, Action
1 output, Action`1 error)
May 15th 2019 12:06:49
Error
at Calamari.Integration.Processes.CommandLineRunner.Execute(CommandLineInvocation invocation)
May 15th 2019 12:06:49
Error
The command that caused the exception was: “C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe” -NoLogo -NonInteractive -ExecutionPolicy Unrestricted -Command “Try {. {. ‘D:\Octopus\Applications\Release<product><version>\Bootstrap.Octopus.Features.IISWebSite_BeforePostDeploy.ps1’ -OctopusKey ‘==’; if ((test-path variable:global:lastexitcode)) { exit $LastExitCode }};} catch { throw }”
May 15th 2019 12:06:49
Error
Script ‘D:\Octopus\Applications\Release<product><version>\Octopus.Features.IISWebSite_BeforePostDeploy.ps1’ returned non-zero exit code: -1