|
56 | 56 | A validated string defining which build edition or "stream" to download - stable or
|
57 | 57 | insiders edition. If the parameter is not used, then stable is downloaded as default.
|
58 | 58 |
|
| 59 | +.PARAMETER User |
| 60 | + When present, the latest VSCode "User Profile" Insider Edition will be installed. |
| 61 | + if BuildEdition is set to "stable" this will revert back to the current standard. |
| 62 | +
|
59 | 63 | .PARAMETER AdditionalExtensions
|
60 | 64 | An array of strings that are the fully-qualified names of extensions to be
|
61 | 65 | installed in addition to the PowerShell extension. The fully qualified
|
@@ -122,6 +126,10 @@ param(
|
122 | 126 | [ValidateSet("stable","insider")]
|
123 | 127 | [string]$BuildEdition = "stable",
|
124 | 128 |
|
| 129 | + [Parameter()] |
| 130 | + [switch] |
| 131 | + $User, |
| 132 | + |
125 | 133 | [Parameter()]
|
126 | 134 | [ValidateNotNull()]
|
127 | 135 | [string[]]$AdditionalExtensions = @(),
|
@@ -167,13 +175,21 @@ if (!($IsLinux -or $IsOSX)) {
|
167 | 175 | break;
|
168 | 176 | }
|
169 | 177 | }
|
| 178 | + if (($User -eq $true) -and ($BuildEdition -eq "Insider")) { |
| 179 | + $codeCmdPath = "$env:LocalAppData\Programs\Microsoft VS Code Insiders\bin\code-insiders.cmd" |
| 180 | + $appName = "Visual Studio Code - Insiders Edition ($($Architecture) - User)" |
| 181 | + $fileUri = "https://vscode-update.azurewebsites.net/latest/$($bitVersion)-user/$($BuildEdition)" |
| 182 | + } |
| 183 | + else { |
| 184 | + $fileUri = "https://vscode-update.azurewebsites.net/latest/$($bitVersion)/$($BuildEdition)" |
| 185 | + } |
170 | 186 | try {
|
171 | 187 | $ProgressPreference = 'SilentlyContinue'
|
172 | 188 |
|
173 | 189 | if (!(Test-Path $codeCmdPath)) {
|
174 | 190 | Write-Host "`nDownloading latest $appName..." -ForegroundColor Yellow
|
175 | 191 | Remove-Item -Force "$env:TEMP\vscode-$($BuildEdition).exe" -ErrorAction SilentlyContinue
|
176 |
| - Invoke-WebRequest -Uri "https://vscode-update.azurewebsites.net/latest/$($bitVersion)/$($BuildEdition)" -OutFile "$env:TEMP\vscode-$($BuildEdition).exe" |
| 192 | + Start-BitsTransfer $fileUri -Destination "$env:TEMP\vscode-$($BuildEdition).exe" |
177 | 193 |
|
178 | 194 | Write-Host "`nInstalling $appName..." -ForegroundColor Yellow
|
179 | 195 | Start-Process -Wait "$env:TEMP\vscode-$($BuildEdition).exe" -ArgumentList /silent, /mergetasks=!runcode
|
|
0 commit comments