title: Force Octopus Deploy step to fail if PostDeploy Powershell script fails
body: <p>In one of my Octopus Deploy steps, I have a Powershell script called <code>PostDeploy.ps1</code> that runs correctly, except that if it encounters an exception, the deployment continues as though it succeeded.</p>
  
  <p>I've seen a few posts about the problems of powershell exit codes, but I can't find a solution for the particular problems of PostDeploy scripts.</p>
  
  <p>How can I force a step to be marked as failed if PostDeploy encounters an error?</p>