In first, there is not any errors in syntax, but in the second there is. Command exits with 1 because variable $APPVEYOR_BUILD_NUMBER is not set (as I tried to do it locally with an empty variable). But how there are not errors in first?