title: Getting a return code from Python for Powershell script
body: <p>EDITED to clean up the info:</p>
  
  <p>I am writing a PowerShell script that will call another script.</p>
  
  <p>Once I get the return code, I want to use it in an <code>if</code> statement:</p>
  
  <p>MY CODE:</p>
  
  <pre><code>if ($LASTEXITCODE -eq $TRUE) {
  # Start job.
  } else {
  # Send failed email
  }
  </code></pre>
  
  <hr>
  
  <p>EDIT 2:
  Correct format as noted by:  Ansgar Wiechers</p>
  
  <pre><code>**if ($LASTEXITCODE -eq 0)** {
  # Start job.
  } else {
  # Send failed email
  }
  </code></pre>