Last active
May 18, 2024 17:25
-
-
Save EmmanuelTsouris/00bcaa9a3787a6451af5567f74b4e1c6 to your computer and use it in GitHub Desktop.
Download and Silently Install Visual Studio Code (VSCode)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
This script installs Visual Studio Code Silently. | |
.DESCRIPTION | |
The script downloads the latest VSCode installer and performs a silent installation. | |
.NOTES | |
Run this script on a Windows Server instance. | |
#> | |
# Define the URL for the VSCode installer | |
$installerUrl = "https://aka.ms/win32-x64-user-stable" | |
# Define the path to save the installer | |
$installerPath = "$env:TEMP\vscode_installer.exe" | |
# Download the VSCode installer | |
Write-Output "Downloading Visual Studio Code..." | |
Invoke-WebRequest -Uri $installerUrl -OutFile $installerPath | |
# Perform the silent installation | |
Write-Output "Installing Visual Studio Code..." | |
Start-Process -FilePath $installerPath -ArgumentList "/silent", "/mergetasks='!runcode,addcontextmenufiles,addcontextmenufolders,associatewithfiles,addtopath'" -NoNewWindow -Wait | |
# Clean up the installer file | |
Remove-Item -Path $installerPath -Force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://code.visualstudio.com/docs/editor/portable
Maybe something like (untested)