-
-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathVisual_Studio.ps1
22 lines (18 loc) · 1.02 KB
/
Visual_Studio.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# https://docs.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio?view=vs-2022
[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://aka.ms/vs/16/release/channel"
OutFile = "$DownloadsFolder\VisualStudio.16.Release.chman"
UseBasicParsing = $true
Verbose = $true
}
Invoke-WebRequest @Parameters
$VS = Get-Content -Path "$DownloadsFolder\VisualStudio.16.Release.chman" -Encoding UTF8 -Force | ConvertFrom-Json
($VS.channelItems | Where-Object -FilterScript {$_.id -eq "VisualStudio.16.Release.Bootstrappers.Setup"}).payloads.url