Disable visual studio extension from command line

Viewed 674

Is it possible to disable a specific extension in Visual Studio from the command line instead of starting Visual Studio manually and disabling it from tools?

2 Answers

I don't know about disabling an extension, by you can uninstall one using VSIXInstaller.exe.

From a Visual Studio Developer Prompt:

VSIXInstaller.exe /uninstall:<vsixid>

Usage

VSIXInstaller.exe [/quiet] [/norepair] [/admin] [/prerequisitesRequired] [/force] [/instanceIds:instanceIds] [/appIdInstallPath:Path to installed SKU] [/appIdName:Name of target install] [/skuName:name /skuVersion:version] [/logFile:filename] </uninstall:vsixID | /downgrade:vsixID | vsix_path>

Options

/quiet

Suppresses the UI. Short form is '/q'.

/norepair

Disables repair support of VSIX Installer and forces the VSIX Installer to fail when the extension is already installed. Short form is '/nr'.

/admin

The extension will be installed to the admin extensions location. Short form is '/a'.

/prerequisitesRequired

Installs the extension only to instances where ALL prerequisites are met. Short form is '/p'.

/force

Allows files to be overwritten. This is only available for the installation of a 'per-machine' extension. Short form is '/f'.

/shutdownprocesses

Force shutdown the blocking processes when UI is being suppressed. Short form is '/sp'.

/noextensionpack

Disables the unpacking of extension pack. Short form is '/noep'.

/appIdInstallPath:<Path to installed SKU>

The installation path of the SKU (product) you want to target for the install. If this option is specified then /appName, /skuName, and

/skuVersion must also be specified.

/appIdName:<name>

The name of the application to which to install or uninstall. e.g. VS, Blend, etc...

/skuName:<name>

The name of the SKU to which to install or uninstall the extension. Must be used with /skuVersion. Valid values include:

  • Enterprise - (Visual Studio Enterprise Edition)

  • Ultimate - (Visual Studio Ultimate Edition)

  • Premium - (Visual Studio Premium Edition)

  • Pro - (Visual Studio Professional Edition)

  • Community - (Visual Studio Community Edition)

  • IntegratedShell - (Visual Studio Shell - Integrated Mode)

  • VSWinExpress - (Visual Studio Express for Windows)

  • VSWinDesktopExpress - (Visual Studio Express for Windows Desktop)

  • 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'.

/logFile:<filename>

Specifies the filename to be used for logging. This file will be appended to if it already exists. Logs will always be placed in %TEMP%. If this is not specified, or is invalid, a filename will be generated. Short forms are '/log' and '/l'.

/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'.

/instanceIds:<instanceId>

A comma separated list of instance IDs into which the extension and its dependencies are installed or uninstalled. If no instance IDs are specified, the extension and its dependencies will be installed into or uninstalled from all instances.

/downgrade:<vsixID>

Reverts an in-product extension with the corresponding identifier to a previously installed version. Short form is '/d'.

/rootSuffix:<root suffix>

A root-suffix to be used for the install, e.g. Exp (for the experimental instance of the targeted install).

/culture:<culture>

A string identifying the culture which the VSIX installer should run under.

Arguments

<vsix_path>

Path to a valid .vsix file. This argument is invalid when /uninstall is specified.

As a supplement,

Command Line cannot disable one installed vs extension and Command Line can only do install or uninstall related operations.

The disable operation is only for VS IDE. In fact, vs extensions itself is designed to be used in the IDE, not the command line. Therefore, only the IDE can get the full functionality to manipulate it.

The VSIXInstaller.exe is a big step taken by Microsoft and the command line operation itself has limitations and room for improvement. But that disable the extension cannot be obtained under Command Line so far.

If you are comfortable uninstalling this particular plugin, you can try Drew's suggestions. If you still want disable it rather than uninstall it, you have to open VS IDE and then click disable option for it.

Or you could suggest a feature on our DC Forum. When you finish it, you could share the link here and anyone who is interested in it including us will vote it so that it will get more attention from Microsoft.

Related