TFS Build:此计算机上未安装“Microsoft.TeamFoundation.PowerShell" [英] TFS Build: `Microsoft.TeamFoundation.PowerShell' is not installed on this computer
问题描述
当我使用本地帐户登录到 tfs 构建服务器并执行以下 powershell 命令时:
When I'm logged in to tfs build server using local account and execute following powershell command:
Add-PSSnapin Microsoft.TeamFoundation.PowerShell
它正确加载了 tfs cmdlet.但是,当我在调用脚本的 tfs 服务器上触发构建时,它失败并显示消息:
it loads the tfs cmdlets correctly. However, when I trigger a build on tfs server that invokes the script, it fails with message:
此计算机上未安装Microsoft.TeamFoundation.PowerShell".
'Microsoft.TeamFoundation.PowerShell' is not installed on this computer.
构建代理在服务帐户下运行.我该怎么办?
The build agent runs under service account. What should I do?
编辑:我不得不从@Alexis Coles 的回答中的第一个链接编辑 reqistry 条目,以使其适用于 TFS PowerTools 2015 版:
EDIT: I had to edit the reqistry entry from the first link in @Alexis Coles' answer to make it work with version 2015 of TFS PowerTools:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftPowerShell1PowerShellSnapInsMicrosoft.TeamFoundation.PowerShell]
"PowerShellVersion"="4.0"
"Vendor"="Microsoft Corporation"
"Description"="This is a PowerShell snap-in that includes the Team Foundation Server cmdlets."
"VendorIndirect"="Microsoft.TeamFoundation.PowerShell,Microsoft"
"DescriptionIndirect"="Microsoft.TeamFoundation.PowerShell,This is a PowerShell snap-in that includes the Team Foundation Server cmdlets."
"Version"="14.0.0.0"
"ApplicationBase"="C:\Program Files (x86)\Microsoft Team Foundation Server 2015 Power Tools"
"AssemblyName"="Microsoft.TeamFoundation.PowerTools.PowerShell, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
"ModuleName"="C:\Program Files (x86)\Microsoft Team Foundation Server 2015 Power Tools\Microsoft.TeamFoundation.PowerTools.PowerShell.dll"
"CustomPSSnapInType"="Microsoft.TeamFoundation.PowerTools.PowerShell.TFPSSnapIn"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftPowerShell1PowerShellSnapInsMicrosoft.TeamFoundation.PowerShell]
"PowerShellVersion"="4.0"
"Vendor"="Microsoft Corporation"
"Description"="This is a PowerShell snap-in that includes the Team Foundation Server cmdlets."
"VendorIndirect"="Microsoft.TeamFoundation.PowerShell,Microsoft"
"DescriptionIndirect"="Microsoft.TeamFoundation.PowerShell,This is a PowerShell snap-in that includes the Team Foundation Server cmdlets."
"Version"="14.0.0.0"
"ApplicationBase"="C:\Program Files (x86)\Microsoft Team Foundation Server 2015 Power Tools"
"AssemblyName"="Microsoft.TeamFoundation.PowerTools.PowerShell, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
"ModuleName"="C:\Program Files (x86)\Microsoft Team Foundation Server 2015 Power Tools\Microsoft.TeamFoundation.PowerTools.PowerShell.dll"
"CustomPSSnapInType"="Microsoft.TeamFoundation.PowerTools.PowerShell.TFPSSnapIn"
仔细检查AssemblyName
、ApplicationBase
、ModuleName
和Version
条目.上述脚本适用于 Microsoft Team Foundation Server 2015 Power Tools
Double check AssemblyName
, ApplicationBase
, ModuleName
and Version
entries. Script above works with Microsoft Team Foundation Server 2015 Power Tools
推荐答案
我将在这里快速说明一下,这可能与 32 位与 64 位 powershell 的关系有关.如果我从正常的 64 位 powershell 运行 Add-PSSnapinicrosoft.TeamFoundation.PowerShell 很好.但是如果我从 C:WindowsSysWOW64WindowsPowerShellv1.0powershell_ise.exe 运行它,我会得到上述异常.我将继续说构建服务器是一个 32 位应用程序,用于启动 32 位运行时.
I am going to have a quick punt here and say it is probably something to do with 32-bit vs 64-bit powershell. If I run Add-PSSnapinicrosoft.TeamFoundation.PowerShell from normal 64-bit powershell fine. But if I run it from C:WindowsSysWOW64WindowsPowerShellv1.0powershell_ise.exe I get the above exception. I am going to go ahead and say that the build server is a 32-bit application and there for starting a 32-bit runtime.
不太确定修复的确切内容,但也许以下内容会为您指明正确的方向.
Not really sure what the fix is exactly but maybe the following will point you in the right direction.
PowerShell(2.0,32 位)无法加载 TFS 2010 管理单元...除非可以
这篇关于TFS Build:此计算机上未安装“Microsoft.TeamFoundation.PowerShell"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!