1

I'm using TFS2015 update 1. I want to pass information from one build step to the next, how is this possible?

That seems like a very simple task, but I can't figure out how that's suppose to work. Passing a variable to a build step is easy, but passing information from one step to the next seems to be impossible. I hope I'm wrong.

1

1 Answer 1

3

You can call the task.setvariable Logging Command, which sets a variable in the variable service of taskcontext. The first task can set a variable, and following tasks are able to use the variable. The variable is exposed to the following tasks as an environment variable. Example:

##vso[task.setvariable variable=testvar;]testvalue 
Sign up to request clarification or add additional context in comments.

1 Comment

I know this was answered (and accepted) MONTHS ago. But it's worth pointing out some emphasis on this needing to be the FIRST task in a build... i had a powershell task as the 3rd step and this setvariable did not work... the documentation glosses over the importance of it needing to be first (i was thinking i could modify the variable mid-tasks and use the updated value in subsequent tasks)... in case anyone else needs this.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.