0

we use the new vNext Build system. I have several steps in my build defintion - example:

Step 1 executes a PowerShell-Script to determine the dynamic path to a specific setup file. How can I save ("cache") this path to use it in step 2. It does not work when I cache this information in an variable (eg "$Env:SetupPathVE")

thx..!

Erik Funkenbusch
  • 92,674
  • 28
  • 195
  • 291
Kollisionskurs
  • 375
  • 1
  • 6
  • 14
  • Something similar has already been asked [here](http://stackoverflow.com/questions/32881749/is-it-possible-to-set-an-vso-build-variable-in-a-build-step-so-that-the-value-ca). Besides, [this](https://github.com/Microsoft/vso-agent-tasks/issues/375) and [this](https://github.com/Microsoft/vso-agent-tasks/issues/559) issues on Github give more information. – Yan Sklyarenko Oct 07 '15 at 14:24
  • sorry I'm little bit confused so... I use this command in my first PowerShell-Script: `Write-Host ##vso[task.setvariable variable=testvar;]"D:test"` and then I can use this variable in the FileCopy-Step with `$(testvar)` in the Source Field ? – Kollisionskurs Oct 07 '15 at 14:42
  • 1
    Yes, this is exactly the way it works in VSO now. However, on premise TFS 2015 RTM does not have this functionality. On premise you can still set the variable value like that, then it turns into ALLCAPS environment variable which you can read **inside** of the next build step. For instance, in the following PowerShell step you'll be able to read your `testvar` as `$env:TESTVAR` – Yan Sklyarenko Oct 08 '15 at 16:16
  • sorry Yan. I've tested it extensively and it does not work with the current 'on premise' version of TFS (Version 14.0.23128.0) – Kollisionskurs Oct 21 '15 at 13:06
  • @Kollisionskurs have you been able to solve this already? Can you show us the content of your scripts so we can help debug? – Wouter de Kort Nov 05 '15 at 19:38

0 Answers0