Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Visual Studio Gallery extensions from command line

TL;DR Is there a way to access Visual Studio Gallery from command line, similar to chocolatey?

I am trying to configure a Visual Studio dev environment using Vagrant. Now, team members use various extensions available from Visual Studio Gallery and it would be great if they could script their installation when provisioning the machine.

If nothing nuget based exists, I guess we could get dirty and use wget to fetch vsix and extract it manually to the proper directory, but I don't know if the download links in VS Gallery are persistent.

like image 942
alh84001 Avatar asked Jun 01 '15 13:06

alh84001


People also ask

How do I install VS Code Extensions in terminal?

You can manually install a VS Code extension packaged in a . vsix file. Using the Install from VSIX command in the Extensions view command dropdown, or the Extensions: Install from VSIX command in the Command Palette, point to the . vsix file.

How do you run the install from VSIX command in VS Code?

All you need to do is press Ctrl+Shift+P and type 'vsix' in the command palette, and VS Code will suggest 'Extensions: Install from vsix…'. When you select this, you need to browse to the file, and hit the 'Install' button.

How do I run VSIXInstaller EXE?

Steps: Open Developer Command Prompt for Visual Studio > type cd XXXX (replace XXXX with the path for example, for VS 2019 Community, C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE ) > press Enter > type VSIXInstaller.exe > press Enter > check if the extension has been installed.


1 Answers

If you run VsixInstaller.exe from the developer command prompt installed with Visual Studio, without parameters, you get a help text message box with this text:

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. 

So, according to this you can do this:

VSIXInstaller.exe /quiet some_extension.vsix 

If you want to run this outside the developer command prompt you probably need to execute the right one for the version of Visual Studio you want to install in.

My version is here:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\VSIXInstaller.exe

like image 135
Lasse V. Karlsen Avatar answered Oct 09 '22 09:10

Lasse V. Karlsen