-
Notifications
You must be signed in to change notification settings - Fork 99
Find VSIXInstaller
Heath Stewart edited this page Mar 6, 2020
·
1 revision
If you want to find VSIXInstaller.exe to install extensions, you only need to get the enginePath
property for any instance because it will resolve to the same place. Do not store this location, however, since the path to VSIXInstaller.exe could one day change.
You could put the following into a batch file, or use the content as an example for use in any script.
@echo off
for /f "usebackq delims=" %%i in (`vswhere -latest -prerelease -products * -property enginePath`) do (
set enginePath=%%i
)
if exist "%enginePath%\VSIXInstaller.exe" (
call "%enginePath%\VSIXInstaller.exe" %*
)
You can declare a helper function like below, or just use the body of the function as an example for use in any script.
function Invoke-VSIXInstaller {
$ErrorActionPreference = 'Stop'
$path = vswhere -latest -prerelease -products * -property enginePath | Join-Path -ChildPath 'VSIXInstaller.exe'
if (Test-Path $path) {
& $path $args
}
}
Copyright (C) Microsoft Corporation. All rights reserved. Licensed under the MIT license. See LICENSE.txt in the project root for license information.