calling build.ps1 from the batch file with -command opition instead of -file as powershell.exe returns 0 in every case when you call it with -file option. Stupid. related to #3