title: MSBuild in a Powershell Script - How do I know if the build succeeded?
body: <p>I am writting a build script with Powershell. The scripts performs various operations such as getting the latest source code off the SVN, backups, etc., and builds the solution using MSBuild:</p>
  
  <pre><code>cmd /c C:\WINDOWS\Microsoft.NET\Framework\v3.5\msbuild.exe "C:\Dev\Path\MyProjct.sln" /p:Configuration=Release 
  </code></pre>
  
  <p>After this instruction, I only want to execute the rest of the script if the compilation succeeded. How can I check this?</p>
  
  <p>The project is a web project, so it's not so easy to check for an output, but I would guess some variables would contain the compilation result. Also since I call msbuild with cmd /c, am I going to be able to access these variables?</p>