When choosing Source code

enter image description here

PS script is running.

When selecting execution from a file of the same script, but only placed in a file and located in VCS

enter image description here

an error occurs, namely, it does not see the% teamcity.build.branch%,% build.vcs.number% variables.

I try to add enter image description here

But it does not lead to anything.

Thank you for any help.

  • one
    because these are configuration variables. you run the file that is running. which searches for environment variables that don't exist. Set the environment variables, give them the config values. variables - Senior Pomidor
  • @SeniorAutomator, Thank you! Once again helping. Can issue, as the answer that I could accept it? - romka.pm

1 answer 1

because these are configuration variables. They are not videos from the environment.

You run a file that is executed that searches for the% teamcity. *% environment variables that are not present. Set the environment variables, give them the config value. variables

%env.myVar% = %teamcity.*% 

Use them in the script

  • one
    This is more correct: “$ BuildCounter = $ env: Build_Counter” At least I’m so drawn. ) - JGooLaaR