如何设置TFS PowerShell Snapin

时间:2023-01-26 22:01:37

I have installed TFS Power Tools and I am trying to use the powershell snapin, but I can't figure out how to set it up. When I look in the install folder, I only see the following 5 dlls.

我已经安装了TFS Power Tools,我正在尝试使用powershell管理单元,但我无法弄清楚如何设置它。当我查看安装文件夹时,我只看到以下5个dll。

Microsoft.TeamFoundation.PowerToys.Client.dll
Microsoft.TeamFoundation.PowerToys.Common.dll
Microsoft.TeamFoundation.PowerToys.Controls.dll
Microsoft.VisualStudio.TeamFoundation.PowerToys.Common.dll
Microsoft.VisualStudio.TeamFoundation.PowerToys.dll

I used instalutil to install each one, and then I used the folowing ps code to see what cmdlets where installed so I could add the snapin but it looks like only a handfull exist in those dlls and these commands are not useful to me right now.

我使用instalutil安装每个,然后我使用下面的ps代码来查看安装的cmdlet,这样我就可以添加snapin但看起来这些dll中只有一个handfull,这些命令现在对我没用。

PS H:\> get-pssnapin -registered


Name        : TfsBPAPowerShellSnapIn
PSVersion   : 1.0
Description : This is a PowerShell snap-in that includes Team Foundation Server cmdlets.



PS H:\> get-command -pssnapin TfsBPAPowerShellSnapIn

    CommandType     Name                                                Definition
    -----------     ----                                                ----------
    Cmdlet          Get-MsiProductId                                    Get-MsiProductId [[-ProductIndex] <Int32>] [[-Mo...
    Cmdlet          Get-TfsDBServer                                     Get-TfsDBServer [[-DBPath] <String>] [-Verbose] ...
    Cmdlet          Get-TfsHealthPing                                   Get-TfsHealthPing [-Verbose] [-Debug] [-ErrorAct...
    Cmdlet          Get-TfsSqlData                                      Get-TfsSqlData [[-ConnectionBuilder] <SqlConnect...

thanks.

谢谢。

4 个解决方案

#1


34  

Any chance you are running on x64? On my x64 system the Microsoft.TeamFoundation.PowerShell snapin only shows up under the x86 flavor of PowerShell. Adding it as simple as:

你有机会在x64上运行吗?在我的x64系统上,Microsoft.TeamFoundation.PowerShell管理单元仅显示在PowerShell的x86风格下。添加它就像:

PS> Add-PSSnapin Microsoft.TeamFoundation.PowerShell

I take it that you installed TF Power Tools October 2008 release. If so, then there is also a shortcut on the start menu for a PowerShell console file that you can fire up. That preloads the TF snapin.

我认为你安装了TF Power Tools 2008年10月发布。如果是这样,那么您可以启动的PowerShell控制台文件的开始菜单上还有一个快捷方式。这预装了TF snapin。

#2


12  

While installing Visual Studio Team Foundation Server 2013 Update 2 Power Tools .msi, I found that I had to re-install and select Modify installation and enable the installation of PowerShell Cmdlets .

在安装Visual Studio Team Foundation Server 2013 Update 2 Power Tools .msi时,我发现必须重新安装并选择Modify installation并启用PowerShell Cmdlet的安装。

#3


2  

@Keith Hill's and @Blakomen's answers are both correct; this and more information is available in the help file.

@Keith Hill和@ Blakomen的答案都是正确的;帮助文件中提供了此信息和更多信息。

Start/All Programs/Microsoft Team Foundation Server 2010 Power Tools/Help Windows PowerShell Cmdlets for Visual Studio Team System Team Foundation Server

开始/所有程序/ Microsoft Team Foundation Server 2010电源工具/帮助Visual Studio Team System Team Foundation Server的Windows PowerShell Cmdlet

Or simply

或者干脆

C:\Program Files (x86)\Microsoft Team Foundation Server 2010 Power Tools\Help\PowerShellCmdlets.mht

C:\ Program Files(x86)\ Microsoft Team Foundation Server 2010电动工具\ Help \ PowerShellCmdlets.mht

(Adjust as necessary for your install folder and version of Power Tools)

(根据需要调整安装文件夹和Power Tools版本)

Note the following (from help Get-TfsItemHistory -full):

请注意以下内容(来自帮助Get-TfsItemHistory -full):

-Server <TeamFoundationServer>
    Identifies the Team Foundation Server. This option is required if the command
    is invoked from a directory that is not mapped to a workspace.

#4


0  

If you haven't used PowerShell at all yet, you may need to enable the execution of remote scripts to get the PowerShell console in the TF Power Tools Oct 2008 release to work. Open up a Powershell console and type in:

如果您尚未使用PowerShell,则可能需要启用远程脚本的执行才能使TF Power Tools 2008年10月发行版中的PowerShell控制台正常工作。打开Powershell控制台并输入:

Set-ExecutionPolicy RemoteSigned

#1


34  

Any chance you are running on x64? On my x64 system the Microsoft.TeamFoundation.PowerShell snapin only shows up under the x86 flavor of PowerShell. Adding it as simple as:

你有机会在x64上运行吗?在我的x64系统上,Microsoft.TeamFoundation.PowerShell管理单元仅显示在PowerShell的x86风格下。添加它就像:

PS> Add-PSSnapin Microsoft.TeamFoundation.PowerShell

I take it that you installed TF Power Tools October 2008 release. If so, then there is also a shortcut on the start menu for a PowerShell console file that you can fire up. That preloads the TF snapin.

我认为你安装了TF Power Tools 2008年10月发布。如果是这样,那么您可以启动的PowerShell控制台文件的开始菜单上还有一个快捷方式。这预装了TF snapin。

#2


12  

While installing Visual Studio Team Foundation Server 2013 Update 2 Power Tools .msi, I found that I had to re-install and select Modify installation and enable the installation of PowerShell Cmdlets .

在安装Visual Studio Team Foundation Server 2013 Update 2 Power Tools .msi时,我发现必须重新安装并选择Modify installation并启用PowerShell Cmdlet的安装。

#3


2  

@Keith Hill's and @Blakomen's answers are both correct; this and more information is available in the help file.

@Keith Hill和@ Blakomen的答案都是正确的;帮助文件中提供了此信息和更多信息。

Start/All Programs/Microsoft Team Foundation Server 2010 Power Tools/Help Windows PowerShell Cmdlets for Visual Studio Team System Team Foundation Server

开始/所有程序/ Microsoft Team Foundation Server 2010电源工具/帮助Visual Studio Team System Team Foundation Server的Windows PowerShell Cmdlet

Or simply

或者干脆

C:\Program Files (x86)\Microsoft Team Foundation Server 2010 Power Tools\Help\PowerShellCmdlets.mht

C:\ Program Files(x86)\ Microsoft Team Foundation Server 2010电动工具\ Help \ PowerShellCmdlets.mht

(Adjust as necessary for your install folder and version of Power Tools)

(根据需要调整安装文件夹和Power Tools版本)

Note the following (from help Get-TfsItemHistory -full):

请注意以下内容(来自帮助Get-TfsItemHistory -full):

-Server <TeamFoundationServer>
    Identifies the Team Foundation Server. This option is required if the command
    is invoked from a directory that is not mapped to a workspace.

#4


0  

If you haven't used PowerShell at all yet, you may need to enable the execution of remote scripts to get the PowerShell console in the TF Power Tools Oct 2008 release to work. Open up a Powershell console and type in:

如果您尚未使用PowerShell,则可能需要启用远程脚本的执行才能使TF Power Tools 2008年10月发行版中的PowerShell控制台正常工作。打开Powershell控制台并输入:

Set-ExecutionPolicy RemoteSigned