Try catch and exit codes for build.ps1