Skip to content

Commit 878b190

Browse files
author
Ben Reader
committed
moved "user" switch into $buildEdition as a validate set option.
1 parent 7ed3357 commit 878b190

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

scripts/Install-VSCode.ps1

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
.EXTERNALSCRIPTDEPENDENCIES
2626
2727
.RELEASENOTES
28+
15/08/2018 - added functionality to install the new "User Install" variant of Insiders Edition.
29+
--
2830
28/12/2017 - added functionality to support 64-bit versions of VSCode
2931
& support for installation of VSCode Insiders Edition.
3032
--
@@ -53,12 +55,10 @@
5355
downloaded instead. If parameter is not used, then 64-bit is used as default.
5456
5557
.PARAMETER BuildEdition
56-
A validated string defining which build edition or "stream" to download - stable or
57-
insiders edition. If the parameter is not used, then stable is downloaded as default.
58+
A validated string defining which build edition or "stream" to download:
59+
Stable or Insiders Edition (system install or user profile install).
60+
If the parameter is not used, then stable is downloaded as default.
5861
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.
6262
6363
.PARAMETER AdditionalExtensions
6464
An array of strings that are the fully-qualified names of extensions to be
@@ -88,9 +88,9 @@
8888
extensions.
8989
9090
.EXAMPLE
91-
Install-VSCode.ps1 -BuildEdition Insider -LaunchWhenDone
91+
Install-VSCode.ps1 -BuildEdition Insider-User -LaunchWhenDone
9292
93-
Installs Visual Studio Code Insiders Edition (64-bit) and then launches the editor
93+
Installs Visual Studio Code Insiders Edition (64-bit) to the user profile and then launches the editor
9494
after installation completes.
9595
9696
.NOTES
@@ -123,8 +123,8 @@ param(
123123
[string]$Architecture = "64-bit",
124124

125125
[parameter()]
126-
[ValidateSet("stable","insider")]
127-
[string]$BuildEdition = "stable",
126+
[ValidateSet("Stable","Insider-System","Insider-User")]
127+
[string]$BuildEdition = "Stable",
128128

129129
[Parameter()]
130130
[switch]$User,
@@ -166,21 +166,23 @@ if (!($IsLinux -or $IsOSX)) {
166166
"Stable" {
167167
$codeCmdPath = "$codePath\Microsoft VS Code\bin\code.cmd"
168168
$appName = "Visual Studio Code ($($Architecture))"
169+
$fileUri = "https://vscode-update.azurewebsites.net/latest/$($bitVersion)/$($BuildEdition)"
170+
169171
break;
170172
}
171-
"Insider" {
173+
"Insider-System" {
172174
$codeCmdPath = "$codePath\Microsoft VS Code Insiders\bin\code-insiders.cmd"
173175
$appName = "Visual Studio Code - Insiders Edition ($($Architecture))"
176+
$fileUri = "https://vscode-update.azurewebsites.net/latest/$($bitVersion)/$($BuildEdition)"
177+
178+
break;
179+
}
180+
"Insider-User" {
181+
$codeCmdPath = "$env:LocalAppData\Programs\Microsoft VS Code Insiders\bin\code-insiders.cmd"
182+
$appName = "Visual Studio Code - Insiders Edition ($($Architecture) - User)"
183+
$fileUri = "https://vscode-update.azurewebsites.net/latest/$($bitVersion)-user/$($BuildEdition)"
174184
break;
175185
}
176-
}
177-
if ($User -and $BuildEdition -eq "Insider") {
178-
$codeCmdPath = "$env:LocalAppData\Programs\Microsoft VS Code Insiders\bin\code-insiders.cmd"
179-
$appName = "Visual Studio Code - Insiders Edition ($($Architecture) - User)"
180-
$fileUri = "https://vscode-update.azurewebsites.net/latest/$($bitVersion)-user/$($BuildEdition)"
181-
}
182-
else {
183-
$fileUri = "https://vscode-update.azurewebsites.net/latest/$($bitVersion)/$($BuildEdition)"
184186
}
185187
try {
186188
$ProgressPreference = 'SilentlyContinue'

0 commit comments

Comments
 (0)