Skip to content

Commit 7c79005

Browse files
Ben ReaderBen Reader
authored andcommitted
archictecture changed to 64-bit // 32-bit. gwmi changed to gcim
1 parent ffa97ff commit 7c79005

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

scripts/Install-VSCode.ps1

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
https://github.com/PowerShell/vscode-powershell/blob/develop/scripts/Install-VSCode.ps1
4949
5050
.PARAMETER Architecture
51-
A validated string defining the bit version to download. Values can be either 64 or 32.
52-
If 64 is chosen and the OS Architecture does not match, then the x86 build will be
51+
A validated string defining the bit version to download. Values can be either 64-bit or 32-bit.
52+
If 64-bit is chosen and the OS Architecture does not match, then the 32-bit build will be
5353
downloaded instead. If parameter is not used, then 64-bit is used as default.
5454
5555
.PARAMETER BuildEdition
@@ -68,7 +68,7 @@
6868
has finished.
6969
7070
.EXAMPLE
71-
Install-VSCode.ps1 -Architecture 32
71+
Install-VSCode.ps1 -Architecture 32-bit
7272
7373
Installs Visual Studio Code (32-bit) and the powershell extension.
7474
.EXAMPLE
@@ -115,8 +115,8 @@
115115
[CmdletBinding()]
116116
param(
117117
[parameter()]
118-
[ValidateSet(,"64","32")]
119-
[string]$Architecture = "64",
118+
[ValidateSet(,"64-bit","32-bit")]
119+
[string]$Architecture = "64-bit",
120120

121121
[parameter()]
122122
[ValidateSet("stable","insider")]
@@ -131,18 +131,19 @@ param(
131131

132132
if (!($IsLinux -or $IsOSX)) {
133133
switch ($Architecture) {
134-
"64" {
134+
"64-bit" {
135135
if ((Get-WmiObject -Class Win32_OperatingSystem).OSArchitecture -eq "64-bit") {
136136
$codePath = $env:ProgramFiles
137137
$bitVersion = "win32-x64"
138138
}
139139
else {
140140
$codePath = ${env:ProgramFiles(x86)}
141141
$bitVersion = "win32"
142+
$Architecture = "32-bit"
142143
}
143144
break;
144145
}
145-
"32" {
146+
"32-bit" {
146147
$codePath = ${env:ProgramFiles(x86)}
147148
$bitVersion = "win32"
148149
break;
@@ -151,26 +152,28 @@ if (!($IsLinux -or $IsOSX)) {
151152
switch ($BuildEdition) {
152153
"Stable" {
153154
$codeCmdPath = "$codePath\Microsoft VS Code\bin\code.cmd"
155+
$appName = "Visual Studio Code ($($Architecture))"
154156
break;
155157
}
156158
"Insider" {
157159
$codeCmdPath = "$codePath\Microsoft VS Code Insiders\bin\code-insiders.cmd"
160+
$appName = "Visual Studio Code - Insiders Edition ($($Architecture))"
158161
break;
159162
}
160163
}
161164
try {
162165
$ProgressPreference = 'SilentlyContinue'
163166

164167
if (!(Test-Path $codeCmdPath)) {
165-
Write-Host "`nDownloading latest $($BuildEdition) Visual Studio Code..." -ForegroundColor Yellow
168+
Write-Host "`nDownloading latest $appName..." -ForegroundColor Yellow
166169
Remove-Item -Force "$env:TEMP\vscode-$($BuildEdition).exe" -ErrorAction SilentlyContinue
167170
Invoke-WebRequest -Uri "https://vscode-update.azurewebsites.net/latest/$($bitVersion)/$($BuildEdition)" -OutFile "$env:TEMP\vscode-$($BuildEdition).exe"
168171

169-
Write-Host "`nInstalling Visual Studio Code..." -ForegroundColor Yellow
172+
Write-Host "`nInstalling $appName..." -ForegroundColor Yellow
170173
Start-Process -Wait "$env:TEMP\vscode-$($BuildEdition).exe" -ArgumentList /silent, /mergetasks=!runcode
171174
}
172175
else {
173-
Write-Host "`nVisual Studio Code is already installed." -ForegroundColor Yellow
176+
Write-Host "`n$appName is already installed." -ForegroundColor Yellow
174177
}
175178

176179
$extensions = @("ms-vscode.PowerShell") + $AdditionalExtensions
@@ -180,7 +183,7 @@ if (!($IsLinux -or $IsOSX)) {
180183
}
181184

182185
if ($LaunchWhenDone) {
183-
Write-Host "`nInstallation complete, starting Visual Studio Code...`n`n" -ForegroundColor Green
186+
Write-Host "`nInstallation complete, starting $appName...`n`n" -ForegroundColor Green
184187
& $codeCmdPath
185188
}
186189
else {

0 commit comments

Comments
 (0)