1111 Enterprise
1212. PARAMETER Channel
1313 Selects which channel of Visual Studio to install. Must be one of these values:
14- Release (the default)
15- Preview
14+ Release/Stable (the default)
15+ Preview/Insiders
1616. PARAMETER Version
1717 Selects which version of Visual Studio to install. Must be one of these values:
1818 2022
19+ 2026
1920. PARAMETER InstallPath
2021 The location on disk where Visual Studio should be installed or updated. Default path is location of latest
2122 existing installation of the specified edition, if any. If that VS edition is not currently installed, default
3536param (
3637 [ValidateSet (' BuildTools' , ' Community' , ' Professional' , ' Enterprise' )]
3738 [string ]$Edition = ' Community' ,
38- [ValidateSet (' Release' , ' Preview' , ' IntPreview' , ' Dogfood' )]
39+ [ValidateSet (' Release' , ' Stable ' , ' Preview' , ' Insiders ' , ' IntPreview' , ' Dogfood' )]
3940 [string ]$Channel = ' Release' ,
40- [ValidateSet (' 2022' )]
41+ [ValidateSet (' 2022' , ' 2026 ' )]
4142 [string ]$Version = ' 2022' ,
4243 [string ]$InstallPath ,
4344 [switch ]$Passive ,
@@ -67,20 +68,42 @@ $ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
6768if (" $Version " -eq " 2022" ) {
6869 $vsversion = 17 ;
6970}
70- $channelUri = " https://aka.ms/vs/$vsversion /release"
71+ elseif (" $Version " -eq " 2026" ) {
72+ $vsversion = 18 ;
73+ }
74+
75+ # Normalize channel names (Stable=Release, Insiders=Preview, Dogfood=IntPreview)
76+ switch ($Channel ) {
77+ ' Stable' { $Channel = ' Release' }
78+ ' Insiders' { $Channel = ' Preview' }
79+ ' Dogfood' { $Channel = ' IntPreview' }
80+ }
81+
7182$responseFileName = " vs.$vsversion "
7283if (" $Edition " -eq " BuildTools" ) {
7384 $responseFileName += " .buildtools"
7485}
75- if (" $Channel " -eq " Dogfood" ) {
76- $Channel = " IntPreview"
77- }
86+
87+ # Channel URIs differ between VS 2022 and VS 2026+
88+ # VS 2022: release, pre, intpreview
89+ # VS 2026+: stable, insiders, intpreview (canary)
7890if (" $Channel " -eq " Preview" ) {
7991 $responseFileName += " .preview"
80- $channelUri = " https://aka.ms/vs/$vsversion /pre"
92+ if ($vsversion -ge 18 ) {
93+ $channelUri = " https://aka.ms/vs/$vsversion /insiders"
94+ } else {
95+ $channelUri = " https://aka.ms/vs/$vsversion /pre"
96+ }
8197} elseif (" $Channel " -eq " IntPreview" ) {
8298 $responseFileName += " .intpreview"
8399 $channelUri = " https://aka.ms/vs/$vsversion /intpreview"
100+ } else {
101+ # Release channel
102+ if ($vsversion -ge 18 ) {
103+ $channelUri = " https://aka.ms/vs/$vsversion /stable"
104+ } else {
105+ $channelUri = " https://aka.ms/vs/$vsversion /release"
106+ }
84107}
85108
86109$responseFile = " $PSScriptRoot \$responseFileName .json"
@@ -107,11 +130,15 @@ if (-not $InstallPath) {
107130}
108131
109132if (-not $InstallPath ) {
110- if ($vsversion -eq " 17 " ) {
133+ if (( $vsversion -eq 17 ) -or ( $vsversion -eq 18 ) ) {
111134 $pathPrefix = " ${env: ProgramFiles} " ;
112135 }
113136 if (" $Channel " -eq " Preview" ) {
114- $InstallPath = " $pathPrefix \Microsoft Visual Studio\$Version \${Edition} _Pre"
137+ if ($vsversion -ge 18 ) {
138+ $InstallPath = " $pathPrefix \Microsoft Visual Studio\$Version \${Edition} _Insiders"
139+ } else {
140+ $InstallPath = " $pathPrefix \Microsoft Visual Studio\$Version \${Edition} _Pre"
141+ }
115142 } elseif (" $Channel " -eq " IntPreview" ) {
116143 $InstallPath = " $pathPrefix \Microsoft Visual Studio\$Version \${Edition} _IntPre"
117144 } else {
0 commit comments