-
Notifications
You must be signed in to change notification settings - Fork 511
adding Bits-Transfer & user switch to install latest user profile insiders edition #1477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
e54f8a6
7ed3357
878b190
b4b6e5e
e393994
b444e32
854a2ce
cc69667
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,10 @@ | |
A validated string defining which build edition or "stream" to download - stable or | ||
insiders edition. If the parameter is not used, then stable is downloaded as default. | ||
|
||
.PARAMETER User | ||
When present, the latest VSCode "User Profile" Insider Edition will be installed. | ||
if BuildEdition is set to "stable" this will revert back to the current standard. | ||
|
||
.PARAMETER AdditionalExtensions | ||
An array of strings that are the fully-qualified names of extensions to be | ||
installed in addition to the PowerShell extension. The fully qualified | ||
|
@@ -122,6 +126,10 @@ param( | |
[ValidateSet("stable","insider")] | ||
[string]$BuildEdition = "stable", | ||
|
||
[Parameter()] | ||
[switch] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The convention in the rest of the file seems to be putting the type constraint on the same line as the parameter There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed and about to check in |
||
$User, | ||
|
||
[Parameter()] | ||
[ValidateNotNull()] | ||
[string[]]$AdditionalExtensions = @(), | ||
|
@@ -167,13 +175,21 @@ if (!($IsLinux -or $IsOSX)) { | |
break; | ||
} | ||
} | ||
if (($User -eq $true) -and ($BuildEdition -eq "Insider")) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should be able to do just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed and about to check in |
||
$codeCmdPath = "$env:LocalAppData\Programs\Microsoft VS Code Insiders\bin\code-insiders.cmd" | ||
$appName = "Visual Studio Code - Insiders Edition ($($Architecture) - User)" | ||
$fileUri = "https://vscode-update.azurewebsites.net/latest/$($bitVersion)-user/$($BuildEdition)" | ||
} | ||
else { | ||
$fileUri = "https://vscode-update.azurewebsites.net/latest/$($bitVersion)/$($BuildEdition)" | ||
} | ||
try { | ||
$ProgressPreference = 'SilentlyContinue' | ||
|
||
if (!(Test-Path $codeCmdPath)) { | ||
Write-Host "`nDownloading latest $appName..." -ForegroundColor Yellow | ||
Remove-Item -Force "$env:TEMP\vscode-$($BuildEdition).exe" -ErrorAction SilentlyContinue | ||
Invoke-WebRequest -Uri "https://vscode-update.azurewebsites.net/latest/$($bitVersion)/$($BuildEdition)" -OutFile "$env:TEMP\vscode-$($BuildEdition).exe" | ||
Start-BitsTransfer $fileUri -Destination "$env:TEMP\vscode-$($BuildEdition).exe" | ||
|
||
Write-Host "`nInstalling $appName..." -ForegroundColor Yellow | ||
Start-Process -Wait "$env:TEMP\vscode-$($BuildEdition).exe" -ArgumentList /silent, /mergetasks=!runcode | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main function of this flag is to install VSCode-Insiders (user edition) right? Instead of non-Insiders edition. If that's the case, I would vote for the flag being called something like
Insiders
for now, and then if we want to make it more complex (e.g. choose between User Profile and non-User Profile) later, we could add another flag.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rjmholt I agree with you. In that case would it make sense for now then to move from the switch into the
$BuildEdition
parameter as a validation value?Something like:
[ValidateSet("stable","insider-system","insider-userprofile")]
??There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's a really good idea!