简体   繁体   English

自定义构建变量

[英]Custom Build variables

My Company works with custom buildsteps based on Powershell scripts. 我的公司使用基于Powershell脚本的自定义构建步骤。

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? 我现在的任务是验证是否可以将这些脚本中的变量“导出”到tfs本身可用的全局构建变量中? Somewhat like $env:build_Myvairable (in script) / $(build.myvariable) (on Tfs). 有点像$env:build_Myvairable (在脚本中) / $(build.myvariable) (在Tfs上)。

You can set variables that can be used in subsequent build tasks in TFS/VSTS by writing: 您可以通过编写以下命令来设置可在TFS / VSTS中的后续构建任务中使用的变量:

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

Out to the log... This will create or update a build variable. 退出日志...这将创建或更新构建变量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM