title: Determine If Solution Compiles using MSBuild and PSake
body: <p>I have put together a PSake (v2.0) build script, and the script is setting the <code>$psake.build_success</code> property as <code>true</code> even thought the call to MSBuild fails.   Can  anyone advise me on how to alter the script so that the <code>$psake.build_success</code> property will correctly return <code>false</code> when the MSBuild call fails?</p>
  
  <p>My PSake build script is as follows:</p>
  
  <pre><code>properties {
      $solutionFile = 'SOLUTION_FILE'
      $buildSuccessfulMessage = 'Solution Successfully Built!'
      $buildFailureMessage = 'Solution Failed to Build!'
      $cleanMessage = 'Executed Clean!'
  }
  
  task default -depends BuildSolution 
  
  task BuildSolution
  {
      msbuild $solutionFile /t:Clean,Build
      if ($psake.build_success) 
      {
          $buildSuccessfulMessage
      } 
      else 
      {
          $buildFailureMessage
      }
  }
  </code></pre>