【问题标题】:Calling TF.exe from PowerShell script in TeamCity在 TeamCity 中从 PowerShell 脚本调用 TF.exe
【发布时间】:2016-04-20 19:39:32
【问题描述】:

我正在尝试从 TeamCity 构建配置的 Powershell 步骤中调用 tf.exe

可执行文件通常位于C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe(或类似地址)。在我的脚本中,我将变量设置为 tf.exe 的路径,如下所示:

$tfsExe = "%env.ProgramFiles(x86)%\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe" 

我已经通过 RDP 访问它来验证构建服务器上 tf.exe 的存在。我还使用以下命令在 powershell 控制台窗口中调用它

& "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf.exe" help

它以以下输出响应,确认它是可访问的并且可以正常工作:

Microsoft (R) TF - Team Foundation Version Control Tool, Version 11.0.50727.1
Copyright (c) Microsoft Corporation.  All rights reserved.
Type tf help <command name> for command line description.
Type tf msdn <command name> for full documentation in Microsoft Document Explorer.
Commands:
tf add         Adds new files and folders from a local file system location to Team Foundation version control.
tf branch      Copies an item or set of items, including metadata and version control history, from one location to another on the Team Foundation version control server and in the workspace.

【问题讨论】:

  • 构建代理是和构建服务器安装在同一台机器上,还是安装在另一台机器上?
  • 它是一台单独的机器,我认为这是问题所在,因为在 RDP'ing 到代理 tf.exe 之后显然没有安装。
  • 太棒了,很高兴检查对您有帮助:)

标签: powershell tfs teamcity teamcity-9.0


【解决方案1】:

这里的问题是脚本是在构建代理而不是构建服务器上执行的。在构建代理上安装 TFS 插件后,tf.exe 即可使用。

【讨论】:

    猜你喜欢
    • 2019-05-23
    • 2015-07-07
    • 2017-05-20
    • 1970-01-01
    • 2014-02-28
    • 2016-06-22
    • 2011-10-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多