I must be doing something differently than what was asked and answered here because the solution does not appear to be working for me: TeamCity, passing an id generated in o
you need to echo that string, e.g.
echo "##teamcity[setParameter name='env.TEST' value='test']"