如何从命令行安装 Visual Studio 画廊扩展
How to install Visual Studio Gallery extensions from command line
TL;DR 有没有办法从命令行访问 Visual Studio 图库,类似于 chocolatey?
我正在尝试使用 Vagrant 配置 Visual Studio 开发环境。现在,团队成员使用 Visual Studio 库中提供的各种扩展,如果他们可以在配置机器时编写安装脚本,那就太好了。
如果不存在任何基于 nuget 的东西,我想我们可能会弄脏并使用 wget 来获取 vsix 并将其手动解压缩到正确的目录,但我不知道 VS Gallery 中的下载链接是否持久。
如果您 运行 VsixInstaller.exe
从使用 Visual Studio 安装的开发人员命令提示符,没有参数,您会得到一个帮助文本消息框,其中包含以下文本:
Usage: VSIXInstaller.exe [/quiet] [/admin] [/skuName:name /skuVersion:version] </uninstall:vsixID | vsix_path>
- OPTIONS -
/quiet
Suppresses the UI. Short form is '/q'.
/admin
The extension will be installed to the admin extensions location. Short form is '/a'.
/skuName:<name>
The name of the application to which to install or uninstall the extension. Must be used with /skuVersion. Valid values include:
- Ultimate - (Visual Studio Ultimate Edition)
- Premium - (Visual Studio Premium Edition)
- Pro - (Visual Studio Professional Edition)
- VSLS - (Visual Studio LightSwitch)
- IntegratedShell - (Visual Studio Shell - Integrated Mode)
- VBExpress - (Visual Basic Express)
- VCSExpress - (Visual C# Express)
- VCExpress - (Visual C++ Express)
- VPDExpress - (Visual Studio Express for Windows Phone)
- VSWinExpress - (Visual Studio Express for Windows)
- VWDExpress - (Visual Studio Express for Web)
Isolated Shell names may also be specified. Short form is '/s'.
/skuVersion:<version>
The version of the application to which to install or uninstall the extension, in the form major.minor[.build[.revision]]. Must be used with /skuName. Short form is '/v'.
/uninstall:<vsixID>
Uninstalls the extension with the specified identifier. If /skuName and /skuVersion are not specified, the extension will be uninstalled from all products that contain the extension with the corresponding identifier. Short form is '/u'.
- ARGUMENTS -
<vsix_path>
Path to a valid .vsix file. This argument is invalid when /uninstall is specified.
所以,根据这个你可以这样做:
VSIXInstaller.exe /quiet some_extension.vsix
如果您想 运行 在开发人员命令提示符之外执行此操作,您可能需要针对要安装的 Visual Studio 版本执行正确的命令。
我的版本在这里:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\VSIXInstaller.exe
TL;DR 有没有办法从命令行访问 Visual Studio 图库,类似于 chocolatey?
我正在尝试使用 Vagrant 配置 Visual Studio 开发环境。现在,团队成员使用 Visual Studio 库中提供的各种扩展,如果他们可以在配置机器时编写安装脚本,那就太好了。
如果不存在任何基于 nuget 的东西,我想我们可能会弄脏并使用 wget 来获取 vsix 并将其手动解压缩到正确的目录,但我不知道 VS Gallery 中的下载链接是否持久。
如果您 运行 VsixInstaller.exe
从使用 Visual Studio 安装的开发人员命令提示符,没有参数,您会得到一个帮助文本消息框,其中包含以下文本:
Usage: VSIXInstaller.exe [/quiet] [/admin] [/skuName:name /skuVersion:version] </uninstall:vsixID | vsix_path>
- OPTIONS -
/quiet
Suppresses the UI. Short form is '/q'.
/admin
The extension will be installed to the admin extensions location. Short form is '/a'.
/skuName:<name>
The name of the application to which to install or uninstall the extension. Must be used with /skuVersion. Valid values include:
- Ultimate - (Visual Studio Ultimate Edition)
- Premium - (Visual Studio Premium Edition)
- Pro - (Visual Studio Professional Edition)
- VSLS - (Visual Studio LightSwitch)
- IntegratedShell - (Visual Studio Shell - Integrated Mode)
- VBExpress - (Visual Basic Express)
- VCSExpress - (Visual C# Express)
- VCExpress - (Visual C++ Express)
- VPDExpress - (Visual Studio Express for Windows Phone)
- VSWinExpress - (Visual Studio Express for Windows)
- VWDExpress - (Visual Studio Express for Web)
Isolated Shell names may also be specified. Short form is '/s'.
/skuVersion:<version>
The version of the application to which to install or uninstall the extension, in the form major.minor[.build[.revision]]. Must be used with /skuName. Short form is '/v'.
/uninstall:<vsixID>
Uninstalls the extension with the specified identifier. If /skuName and /skuVersion are not specified, the extension will be uninstalled from all products that contain the extension with the corresponding identifier. Short form is '/u'.
- ARGUMENTS -
<vsix_path>
Path to a valid .vsix file. This argument is invalid when /uninstall is specified.
所以,根据这个你可以这样做:
VSIXInstaller.exe /quiet some_extension.vsix
如果您想 运行 在开发人员命令提示符之外执行此操作,您可能需要针对要安装的 Visual Studio 版本执行正确的命令。
我的版本在这里:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\VSIXInstaller.exe