Custom Build variables

281 Views Asked by At

My Company works with custom buildsteps based on Powershell scripts.

My task now is to verify whether it is possible to 'export' Variables form these scripts to the global build variables available in tfs itself? Somewhat like $env:build_Myvairable (in script) / $(build.myvariable) (on Tfs).

1

There are 1 best solutions below

3
MrHinsh - Martin Hinshelwood On BEST ANSWER

You can set variables that can be used in subsequent build tasks in TFS/VSTS by writing:

"##vso[task.setvariable variable=testvar;]testvalue"

Out to the log... This will create or update a build variable.