【问题标题】:Set Visual Studio source control provider in a script在脚本中设置 Visual Studio 源代码管理提供程序
【发布时间】:2017-12-19 19:44:38
【问题描述】:

Visual Studio 2017 具有源控制提供程序(Team Foundation Server、Git 等)的设置。有谁知道如何从脚本或 Visual Studio 存储此设置的位置设置此设置?

【问题讨论】:

    标签: git visual-studio visual-studio-2017 team-explorer


    【解决方案1】:

    可以使用vsregedit.exe 设置源代码控制提供程序。

    通过 PowerShell 脚本将 Git 设置为源代码控制提供程序:

    $vsWherePath = Join-Path ${env:ProgramFiles(x86)} "Microsoft Visual Studio\Installer\vswhere.exe"
    $vsVersion = "[15.0,16.0)"
    $installPath = &$vsWherePath -all -latest -version $vsVersion -property installationPath
    $vsregedit = Join-Path $installPath 'Common7\IDE\vsregedit.exe'
    
    
    &$vsregedit set "$installPath" HKCU CurrentSourceControlProvider `"`" string "{11B8E6D7-C08B-4385-B321-321078CDD1F8}"
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-26
    • 1970-01-01
    • 1970-01-01
    • 2012-09-16
    • 1970-01-01
    • 2019-04-12
    • 2021-12-30
    • 1970-01-01
    相关资源
    最近更新 更多