-
-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathVSCode.ps1
19 lines (16 loc) · 906 Bytes
/
VSCode.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
if ($Host.Version.Major -eq 5)
{
# Progress bar can significantly impact cmdlet performance
# https://github.com/PowerShell/PowerShell/issues/2138
$Script:ProgressPreference = "SilentlyContinue"
}
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}"
$Parameters = @{
Uri = "https://code.visualstudio.com/sha/download?build=stable&os=win32-x64"
OutFile = "$DownloadsFolder\VSCodeSetup-x64.exe"
Verbose = $true
}
Invoke-WebRequest @Parameters
# https://code.visualstudio.com/docs/setup/windows#_common-questions
Start-Process -FilePath "$DownloadsFolder\VSCodeSetup-x64.exe" -ArgumentList "/mergetasks=`"!runcode,!addcontextmenufiles,!addcontextmenufolders,!associatewithfiles,addtopath`"" -Wait