0
votes

Im simply trying to pass value between build steps in TeamCity. Im currently using PowerShell.

My Powershell code looks like

    $guid = [guid]::NewGuid().ToString()
    echo "##teamcity[setParameter name='env.test' value='$guid']"

    echo %env.test%

When I save this step and then run configuration all I get is following error

Warning: No enabled compatible agents for this build configuration. Please register a build agent or tweak build configuration requirements.

Print screen of an error

When I remove usage of %env.test% (= last line) variable everything works fine, but the problem is of course that I cannot use this variable anywhere.

Any help is appreciated

1

1 Answers

0
votes

You can check the list of undefined parameters if you press on lightbulb left to the Run button or if you go to the build configuration > Parameters page. You'll see there that env.test parameter "value is required". You need to define it (empty value can be used).