Advertisement
eeweww

VSCode installer

Jul 13th, 2023
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Install-VSCode
  2.  
  3. # Download URL, you may need to update this if it changes
  4. $downloadUrl = "https://go.microsoft.com/fwlink/?LinkID=623230"
  5.  
  6. # What to name the file and where to put it
  7. $installerFile = "vscode-install.exe"
  8. $installerPath = (Join-Path $env:TEMP $installerFile)
  9.  
  10. # Install Options
  11. # Reference:
  12. # http://stackoverflow.com/questions/42582230/how-to-install-visual-studio-code-silently-without-auto-open-when-installation
  13. # http://www.jrsoftware.org/ishelp/
  14.  
  15. # Install with the context menu, file association, and add to path options (and don't run code after install:
  16. $installerArguments = "/verysilent /mergetasks='!runcode,addcontextmenufiles,addcontextmenufolders,associatewithfiles,addtopath'"
  17.  
  18. #Install with default options, and don't run code after install.
  19. #$installerArguments = "/verysilent /mergetasks='!runcode'"
  20. Invoke-Webrequest $downloadUrl -UseBasicParsing -OutFile $installerPath
  21. Start-Process $installerPath -ArgumentList $installerArguments -Wait
  22. Remove-Item $installerPath -Force
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement