Lie*_*ero 7 build-automation powershell tfs tfsbuild tfs-power-tools
当我使用本地帐户登录到tfs构建服务器并执行以下powershell命令时:
Add-PSSnapin Microsoft.TeamFoundation.PowerShell
Run Code Online (Sandbox Code Playgroud)
它正确加载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"
Run Code Online (Sandbox Code Playgroud)
仔细检查AssemblyName,ApplicationBase,ModuleName和Version项.上面的脚本适用于Microsoft Team Foundation Server 2015 Power Tools
我遇到了这个问题,为了解决这个问题,我注意到默认情况下,在PowerTools安装过程中不会添加cmdlet.您需要运行完整安装才能使其正常运行.
我在这里发布了一些图片:https: //fabiostawinski.wordpress.com/2016/07/11/the-windows-powershell-snap-in-microsoft-teamfoundation-powershell-is-not-installed-on-this-computer/
我要在这里快速说一下,这可能与 32 位与 64 位 powershell 有关。如果我从正常的 64 位 powershell 运行 Add-PSSnapinicrosoft.TeamFoundation.PowerShell 就可以了。但是,如果我从 C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell_ise.exe 运行它,则会出现上述异常。我将继续说构建服务器是一个 32 位应用程序,用于启动 32 位运行时。
不太确定修复到底是什么,但也许以下内容将为您指明正确的方向。
PowerShell(2.0,32 位)无法加载 TFS 2010 管理单元...除非可以
| 归档时间: |
|
| 查看次数: |
11632 次 |
| 最近记录: |