Powershell wrapped LastExitCode

I have my ps1 scripts with the following pragma: Set-StrictMode -Version Latest

After installing latests of octopus - it fails because the powershell hosting has changed.

ERROR: The variable ‘$LastExitCode’ cannot be retrieved because it has not been set.

I need my scripts to run in StrictMode so that variables are not used when not set - rm $val* problem I posted a long time ago.

Hi Leblanc,

Thanks, I’ll fix this bug in the next release. In the mean time you can use
the old PowerShell host (set OctopusUseLegacyPowerShellEngine to true) to
get the old behavior.


Paul Stovell
Octopus Deploy
W: octopusdeploy.com | T: @octopusdeploy http://twitter.com/octopusdeploy

awesome! : ) - i remember reading the article but it was a while back.