[英]Access MSBuild from Post Build Powershell Script
I'm using the default process template that comes with TFS 2013
and I have a post build script that runs after the build is done. 我正在使用
TFS 2013
随附的默认流程模板,并且在构建完成后运行一个后构建脚本。 The script is a Powershell
script that copies over some files required for me to generate an MSI. 该脚本是
Powershell
脚本,可复制我生成MSI所需的某些文件。 What I want to know is how to retrieve information about my build such as the MSBuild Arguments
that I stated. 我想知道的是如何检索有关我的构建的信息,例如我所说的
MSBuild Arguments
。 I need to get the value that I set in the build definition. 我需要获取在构建定义中设置的值。 Is there a way that I can access this without writing functions that go on
TFS
and retrieve the build definition information? 有没有一种方法可以访问此方法而无需编写在
TFS
上运行的函数并检索构建定义信息?
Quite a few of the TFS variables get defined as environment variables. 相当多的TFS变量被定义为环境变量。 See these example scripts: https://tfsbuildextensions.codeplex.com/SourceControl/latest#Scripts/GatherItemsForDrop.ps1 Here is the environment variable reference: http://msdn.microsoft.com/en-us/library/hh850448.aspx While that doesn't contain an env var for MSBuild arguments, you can always pass the same arguments to your PowerShell script via the
post-build script arguments
process parameter. 请参阅以下示例脚本: https : //tfsbuildextensions.codeplex.com/SourceControl/latest#Scripts/GatherItemsForDrop.ps1这是环境变量参考: http : //msdn.microsoft.com/zh-cn/library/hh850448.aspx虽然其中不包含MSBuild参数的env var,但是您始终可以通过
post-build script arguments
process参数将相同的参数传递给PowerShell脚本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.