即使安装了 Team Foundation 电动工具,Jenkins 也无法识别它
问题:即使安装了 Team Foundation 电动工具,Jenkins 也无法识别它
我已将 Team Foundation 电动工具安装到 Jenkins 服务器。我安装了带有完整 VS 2015 的 TFS 2015。我想运行从 TFS 提取项目的 powershell 脚本。我可以从 Jenkins 服务器运行它。当我尝试使用 powershell 插件从 Jenkins 构建定义中传递该脚本时。我收到有关 Team Foundation 电动工具的错误。詹金斯抱怨没有安装团队基础电动工具。我试图卸载并重新安装工具。我的 Jenkins 服务通过使用我安装了这个工具在相同的环境下运行。此外,此工具不是特定于用户的。它是为所有用户安装的。有人可以帮忙吗?
Add-PSSnapin:此计算机上未安装 Windows PowerShell 管理单元“Microsoft.TeamFoundation.PowerShell”。在 C:\Users\AppData\Local\Temp\jenkins4325377511943060199.ps1:22 char:1 + Add-PSSnapin Microsoft.TeamFoundation.PowerShell + ~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (Microsoft.TeamFoundation.PowerShell:String) [Add-PSSnapin], PSArgument 异常 + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand Get-TfsChildItem : 术语“Get-TfsChildItem”未被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名称的拼写,或者如果包含路径,请验证路径是否正确并重试。在 C:\Users\AppData\Local\Temp\jenkins4325377511943060199.ps1:25 char:10 + $items u003d Get-TfsChildItem $AutoDeployDir -Recurse -Server $tfsCollection + ~~~~~~~~~~~~~~ ~~ + CategoryInfo : ObjectNotFound: (Get-TfsChildItem:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
如您所见,我可以在服务器内部手动运行它。
解答
我想到了。这是 x32 和 x64 之间的工具的问题。您将需要添加注册表来解决此问题。在 *.reg 文件中复制以下内容并双击文件将其安装到注册表。
Windows 注册表编辑器版本 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.TeamFoundation.PowerShell] "PowerShellVersion"u003d"4.0" "Vendor"u003d"Microsoft Corporation" "Description"u003d “这是一个包含 Team Foundation Server cmdlet 的 PowerShell 管理单元。” "VendorIndirect"u003d"Microsoft.TeamFoundation.PowerShell,Microsoft" "DescriptionIndirect"u003d"Microsoft.TeamFoundation.PowerShell,这是一个包含 Team Foundation Server cmdlet 的 PowerShell 管理单元。" "Version"u003d"14.0.0.0" "ApplicationBase"u003d"C:\Program Files (x86)\Microsoft Team Foundation Server 2010 Power Tools" "AssemblyName"u003d"Microsoft.TeamFoundation.PowerTools.PowerShell, Versionu003d14.0.0.0, Cultureu003dneutral, PublicKeyTokenu003db03f5f7f11d50a3a" "ModuleName"u003d"C:\Program Files (x86)\Microsoft Team Foundation Server 2015 Power Tools\Microsoft.TeamFoundation.PowerTools.PowerShell.dll" "CustomPSSnapInType"u003d"Microsoft.TeamFoundation.PowerTools .PowerShell.TFPSSnapIn"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.TeamFoundation.PowerShell] "PowerShellVersion"u003d"4.0" "Vendor"u003d"Microsoft Corporation" "Description"u003d"This is一个包含 Team Foundation Server cmdlet 的 PowerShell 管理单元。” "VendorIndirect"u003d"Microsoft.TeamFoundation.PowerShell,Microsoft" "DescriptionIndirect"u003d"Microsoft.TeamFoundation.PowerShell,这是一个包含 Team Foundation Server cmdlet 的 PowerShell 管理单元。" "Version"u003d"14.0.0.0" "ApplicationBase"u003d"C:\Program Files (x86)\Microsoft Team Foundation Server 2010 Power Tools" "AssemblyName"u003d"Microsoft.TeamFoundation.PowerTools.PowerShell, Versionu003d14.0.0.0, Cultureu003dneutral, PublicKeyTokenu003db03f5f7f11d50a3a" "ModuleName"u003d"C:\Program Files (x86)\Microsoft Team Foundation Server 2015 Power Tools\Microsoft.TeamFoundation.PowerTools.PowerShell.dll" "CustomPSSnapInType"u003d"Microsoft.TeamFoundation.PowerTools .PowerShell.TFPSSnapIn"
不要忘记根据您的设置更改 PowerShellVersion 和 TFS 版本。如果版本不匹配,它将不起作用。我从http://www.it1me.com/it-answers?idu003d35292971&ttlu003dTFS+Build%3A+%60Microsoft.TeamFoundation.PowerShell%26%2339%3B+is+not+installed+on+this +电脑
更多推荐
所有评论(0)