How to pass custom variables from TFS 2015 Build definition for shell shell script?

I am working on vNext TFS 2015 builds. How can we pass a custom variable from vNext build to a shell shell script? I add a powershell script as a step in the build definition.

+7
powershell visual-studio-2015 tfsbuild vsts-build tfs2015
source share
2 answers

You can define assembly variables and then refer to them in the PowerShell task in arguments. For example, if my powershell script took the foo parameter, I could do this:

enter image description here enter image description here

+13
source share

You can access the following user V variables in the power shell, as shown below,

Example:

$env:foo 

In your case,

 blah.ps1 -foo $env:foo 
0
source share

All Articles