title: Jenkins: stop job at the middle from powershell
body: <p>I have a Jenkins job which executes several powershell scripts, with the help of powershell plugin for jenkins (each script is in a different stage of the job).</p>
  
  <p>In one of the stages there's an <code>if</code> condition, if this condition evaluates to <code>true</code>, I need to stop the job and mark it as success.</p>
  
  <p>Here's the relevant part in the powershell script in the relevant stage:</p>
  
  <pre><code># ....        
  $is_after_restart = $content
      if ($is_after_restart -eq "true")
      {
          # Need to mark build as success and abort it.
      }
  </code></pre>
  
  <p>How can this be achieved?</p>
  
  <p>Thanks.</p>