Table of Contents
Installing the VS Code using PowerShell
Would you like to learn how to install VS Code using Powershell? In this tutorial, we are going to show you how to use Powershell to install VS Code on a computer running Windows.
- Create a temporary directory to store VS Code.
- Download the VS Code installer.
- Perform a silent installation of VS Code.
Full script to download and install VS Code using a PowerShell.
#Create a temporary directory to store VSCode.
md -Path $env:temp\chromeinstall -erroraction SilentlyContinue | Out-Null
$Download = join-path $env:temp\chromeinstall vscodesetup.exe
#Download the VSCode installer.
Invoke-WebRequest 'https://code.visualstudio.com/sha/download?build=stable&os=win32-x64-user' -OutFile $Download
#Perform a silent installation of VSCode.
Invoke-Expression "$Download /silent /install"
If your Windows running an older PowerShell versions, let’s using the following script to download and install the latest version of Visual Studio Code.
#Create a temporary directory to store VSCode.
md -Path $env:temp\chromeinstall -erroraction SilentlyContinue | Out-Null
#Download the VSCode installer.
$Download = join-path $env:temp\chromeinstall chrome_installer.exe
(new-object System.Net.WebClient).DownloadFile('https://code.visualstudio.com/sha/download?build=stable&os=win32-x64-user',$Download)
#Perform a silent installation of VSCode.
Invoke-Expression "$Download /silent /install"
5/5 - (1 vote)