Get-VSCode.cmd 783 B

12345678910111213141516171819202122
  1. <# : Begin batch (batch script is in commentary of powershell v2.0+)
  2. @echo off
  3. : Use local variables
  4. setlocal
  5. : Invoke this file as powershell expression
  6. powershell -executionpolicy remotesigned -Command "Invoke-Expression $([System.IO.File]::ReadAllText('%~f0'))"
  7. : Restore environment variables present before setlocal and restore current directory
  8. endlocal
  9. : optionally if double clicked pause
  10. : echo %cmdcmdline%|find /i """%~f0""">nul && pause
  11. : End batch - go to end of file
  12. goto:eof
  13. #>
  14. # here start your powershell script
  15. $url = "https://code.visualstudio.com/sha/download?build=stable&os=win32-x64-user"
  16. $dest = $env:TEMP + "\VSCodeUserSetup-x64.exe"
  17. Start-BitsTransfer -Source $url -Destination $dest
  18. &$dest /SILENT /VERYSILENT /CLOSEAPPLICATIONS /FORCECLOSEAPPLICATIONS