-
-
Notifications
You must be signed in to change notification settings - Fork 223
/
install-vsix.ps1
47 lines (36 loc) · 1.43 KB
/
install-vsix.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<#
.SYNOPSIS
Install the InstallerProjects VS Extension to support vdproj Deployment Project builds
#>
param ()
Begin
{
function InstallVSExtensions
{
$root = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
$installer = "$root\Common7\IDE\vsixinstaller.exe"
# TODO: currently for VS2022
# TODO: update these versions every now and then...
InstallVsix $installer 'InstallerProjects' 'VisualStudioClient/vsextensions/MicrosoftVisualStudio2022InstallerProjects/2.0.0/vspackage'
Write-Host
Write-Host '... Waiting a minute for the VSIXInstaller processes to complete' -ForegroundColor Yellow
Start-Sleep 60
}
function InstallVsix
{
param($installer, $name, $uri)
Write-Host "... installing $name extension in the background" -ForegroundColor Yellow
$url = "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/$uri"
$vsix = "$($env:TEMP)\$name`.vsix"
# download package directly from VS Marketplace and install
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'
$progressPreference = 'silentlyContinue'
Invoke-WebRequest $url -OutFile $vsix
$progressPreference = 'Continue'
& $installer /quiet /norepair $vsix
}
}
Process
{
InstallVSExtensions
}