Powershell搭建步骤Team city

Powershell build step Team city

我正在尝试设置 teamcity,但在添加 powershell 构建步骤时遇到了问题。尝试 运行 构建时出现以下错误,但是如果我删除此构建步骤,构建 运行s.

"Warning: No enabled compatible agents for this build configuration. Please register a build agent or tweak build configuration requirements."

下面是构建步骤配置的屏幕截图。如果有人对如何解决此问题有任何想法,请告诉我。

谢谢

可能有两个原因:

  1. 检查 PowerShell 是否安装在安装了 TeamCity 服务器或代理的机器上
  2. 如果有 PowerShell,则检查 TeamCity Agent 是否在系统配置文件或特定用户帐户下 运行

当 TeamCity 代理服务器上未安装特定软件时会发生这种情况

在您的配置中,在左侧面板上,您有一个子菜单:Agent Requirements

在里面,你拥有所有Build Steps Requirements。在您的情况下,您应该:

  • 参数名称: powershell_x86
  • 条件:存在

然后,在这个块下面你可以看到Agents compatibility。在您的情况下,您的代理人似乎在右侧,在 Uncompatible agents 下,但未满足要求:powershell_x86 exists.

您应该确保没有错误。单击您的代理,然后在 Agent Parameters 选项卡的 Configuration Parameters 子选项卡上,您应该看到:

  • powershell_x86: 5.0
  • powershell_x86_path: C:\Windows\SysWOW64\WindowsPowerShell\v1.0

如果没有出现,说明没有安装powershell。或者您在启动代理后安装了它。在这种情况下,只需在安装 powershell 后重新启动您的服务代理即可。