当我使用本地帐户登录到tfs构建服务器并执行以下powershell命令时:
Add-PSSnapin Microsoft.TeamFoundation.PowerShell它正确地加载tfs cmdlet。但是,当我在tfs服务器上触发一个调用脚本的构建时,它会失败,并发出消息:
这台计算机上没有安装“Microsoft.TeamFoundation.PowerShell”。
生成代理在服务帐户下运行。我该怎么办?
编辑:我必须编辑@Alexis Coles的答案中的第一个链接中的reqistry,以使其与TFS PowerTools的2015版一起工作:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.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_MACHINE\SOFTWARE\Wow6432Node\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.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条目。以上脚本适用于 2015电动工具
发布于 2016-02-09 13:49:40
我将在这里进行一个快速的押注,并说这可能与32位对64位powershell有关。如果我从普通的64位powershell运行Add-PSSnapinicrosoft.TeamFoundation.PowerShell的话。但是,如果我从C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell_ise.exe运行它,就会得到上面的异常。我将继续说,构建服务器是一个32位应用程序,并在那里启动32位运行时。
不太确定修复到底是什么,但也许下面的内容会为您指明正确的方向。
PowerShell (2.0, 32-bit) can't load TFS 2010 snap-in... except when it can
发布于 2016-07-11 21:16:28
我遇到了这个问题,为了解决这个问题,我注意到在默认情况下,在PowerTools安装期间没有添加cmdlet。您需要运行一个完整的安装,以使其工作。
发布于 2019-04-03 12:23:05
对我来说,这是另一个问题,因为我试图使用只安装了VisualStudio2017 Pro的电动工具。
对于Visual 2017,他们没有发布Microsoft Team Foundation Server 2017 Power Tools。他们说,以前的版本应该适用于任何具有TFS的Visual的更高版本。
问题是,如果只安装了Visual 2017,就无法安装Microsoft Team Foundation Server 2015 Power Tools,因为安装Visual 2015 (任何版本)是安装Microsoft Team Foundation Server 2015 Power Tools的必要条件。
换句话说,我必须安装Visual Sudio 2015,然后安装Microsoft Team Foundation Server 2015 Power Tools,然后Add-PSSnapin Microsoft.TeamFoundation.PowerShell才能工作。
希望这能帮上忙。
https://stackoverflow.com/questions/35292971
复制相似问题