MsBuild: Version is not pushed to TeamCity by script

When running in TeamCity the TeamCity version isn't properly evaluated which means the version won't be pushed to TeamCity.