代码之家  ›  专栏  ›  技术社区  ›  under

如何在使用Visual Studio 2017的计算机上安装用于TFS的PowerShell commandlets

  •  0
  • under  · 技术社区  · 6 年前

    我有一些与TFS一起工作的PowerShell脚本。我以前有一个安装了PowerTools的visualstudio2015,所以它运行得很好。

    我现在有了一台带有Visual Studio 2017的新计算机,无法使用PowerTools部署安装Commandlet。我有什么选择?

    安装VS2015对我来说不是一个选择(也不是一个长期的解决方案)。

    我试过:

    Add-PSSnapin Microsoft.TeamFoundation.PowerShell
    

    但出现一个错误,说明未安装Microsoft.TeamFoundation.PowerShell。 试图安装它,得到一个错误,模块没有找到。

     Install-Module  Microsoft.TeamFoundation.PowerShell
    

    2 回复  |  直到 6 年前
        1
  •  1
  •   Shayki Abramczyk Cece Dong - MSFT    6 年前

    :

    1. 打开PowerShell。
    2. Chocolatey

      Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

    3. 下载TFS Power Tools安装程序: Invoke-WebRequest -OutFile Install-TFPT.ps1 https://gist.githubusercontent.com/jrotello/2b9cd552e764e1cf364a3535b1dcc315/raw/Install-TFPT.ps1

    4. 安装PowerShell cmdlet: ./Install-TFPT.ps1 -InstallDirectory <installPath>

    5. 成功执行安装脚本后,可以使用以下命令将PowerShell管理单元加载到会话中,或将该命令添加到PowerShell配置文件中,以便将管理单元加载到您创建的每个PowerShell会话中。 Add-PSSnapin Microsoft.TeamFoundation.PowerShell

    你能找到的另一种方法 here .

    此外,您还可以下载的另一个TFS PowerShell模块 Leon Jalfon

    https://github.com/leonjalfon1/tfs-powershell-module

        2
  •  0
  •   Victor Silva    6 年前

    据我所知,TFS 2017没有PowerTools。您可以阅读 releases notes

    但是,存在一个从伊戈尔阿瓦德回购( Github account ). 他有一个公共存储库:

    https://github.com/igoravl/tfscmdlets .

    你可以试试这个。