Sunday 15 April 2012

powershell - Determine If Solution Compiles using MSBuild and PSake -


I put together a PSake (v2.0) build script, and set the script $ psake Used to be. Build_success as property true even thought that calls to MSBuild fails. Can someone advise me to change the script so that the $ psake.build_success property can correctly return the false when the MSBuild call fails?

My PSake build script is as follows:

  properties {$ solutionFile = 'SOLUTION_FILE' $ buildSuccessfulMessage = 'The solution was successfully created!' $ BuildFailureMessage = 'Failed to create solution!' $ Clean Message = 'Execute Clean!' } Work default - BuildSolution creates the work BuildSolution {msbuild $ solutionFile / t: clean, build ($ psake.build_success) {$ buildSuccessfulMessage} and {$ buildFailureMessage}}  

What is the use of PowerShell in the original $ lastExitCode (i.e., WIn32 ExitCode) reference? I guess the one built in is only relevant when you are bringing a CMDlet related to a semicam.

i.e., replace the check with

  (if $ Lastexitcode -eq 0) { 

Disclaimer: Experience only the podcast level of psake With: D


No comments:

Post a Comment