How to pass build parameters and other information to powershell script in TFS2013 build? How to pass build parameters and other information to powershell script in TFS2013 build? powershell powershell

How to pass build parameters and other information to powershell script in TFS2013 build?


Figured it out.

Variables are automatically written as environment variables, dir env: showed me that tfs automatically create following variables:

 TF_BUILD                       True TF_BUILD_BINARIESDIRECTORY     C:\WP0\101\bin TF_BUILD_BUILDDEFINITIONNAME   TfsBuildTest2 TF_BUILD_BUILDDIRECTORY        C:\WP0\101 TF_BUILD_BUILDNUMBER           TfsBuildTest2_20140310.3 TF_BUILD_BUILDREASON           Manual TF_BUILD_BUILDURI              vstfs:///Build/Build/6521 TF_BUILD_DROPLOCATION TF_BUILD_SOURCEGETVERSION      C22404 TF_BUILD_SOURCESDIRECTORY      C:\WP0\101\src TF_BUILD_TESTRESULTSDIRECTORY  C:\WP0\101\tst TFS_REG_CRED                   Build