Looking for some help on writing a PowerShell script to install Visual Studio Code. I have downloaded the Windows 64 System installer: VSCodeSetup-x64-1.56.2
My script so far:
$fullPath = <<Installer location>>
$vscApp = "VSCodeSetup-x64-1.56.2"
$appPath = join-path $fullPath $vscApp
Write-Host "App Path" $appPath
$arguments = '/SILENT /ALLUSERS /mergetasks="!runcode,????, ????, ???? ,????"'
Start-Process $appPath $arguments -Verb RunAs -Wait
I need the list of internal names for all of the check box items on the "Select Additional Tasks" Select Additional Tasks GUI Screenshot
I want to turn on all four other tasks, both Add Open, Register code, and Add to Path. Only 1 of which seems to be default. While I do not need the desktop icon, from the Inno Setup docs, https://jrsoftware.org/ishelp/index.php?topic=setupcmdline , I can see the desktop Icon name is desktopicon
. How and where would I find this list?
Thanks for any and all help!
Continuing from my comment. There are several pre-built scripts, in several GitHub Repos for silent installs:
#Install-VSCode
# Download URL, you may need to update this if it changes
$downloadUrl = "https://go.microsoft.com/fwlink/?LinkID=623230"
# What to name the file and where to put it
$installerFile = "vscode-install.exe"
$installerPath = (Join-Path $env:TEMP $installerFile)
# Install Options
# Reference:
# http://stackoverflow.com/questions/42582230/how-to-install-visual-studio-code-silently-without-auto-open-when-installation
# http://www.jrsoftware.org/ishelp/
# I'm using /silent, use /verysilent for no UI
# Install with the context menu, file association, and add to path options (and don't run code after install:
$installerArguments = "/silent /mergetasks='!runcode,addcontextmenufiles,addcontextmenufolders,associatewithfiles,addtopath'"
#Install with default options, and don't run code after install.
#$installerArguments = "/silent /mergetasks='!runcode'"
Write-Verbose "Downloading $installerFile..."
Invoke-Webrequest $downloadUrl -UseBasicParsing -OutFile $installerPath
Write-Verbose "Installing $installerPath..."
Start-Process $installerPath -ArgumentList $installerArguments -Wait
Write-Verbose "Cleanup the downloaded file."
Remove-Item $installerPath -Force
You can also automate installing VSCode extensions.
Visual Studio Code: Getting Started with PowerShell https://social.technet.microsoft.com/wiki/contents/articles/35780.visual-studio-code-getting-started-with-powershell.aspx
code --install-extension ms-vscode.powershell
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.