1

如何在 Pre-Build / Post-Build 脚本中访问我的构建过程参数。我不能在参数中传递它,因为我需要在排队这个 Build 之前提示用户询问他的版本号。我试过 $env:MyVariableName 但它是空的。

4

1 回答 1

0

If when he queues the build, he can provide the version number, that version number can become an input parameter in the process template that is then passed as a parameter to the powershell activity that then passes it to your script, which can then be accessed via Param($version).

But, if you still need to directly access the build definition process parameters, you need use C# and the TFS API as with this:

How to Deserialize and Serialize Build Process Parameters in TFS

于 2015-02-05T19:26:26.823 回答