Skip to content

Instantly share code, notes, and snippets.

@alexandrejulien
Last active June 26, 2022 16:01
Show Gist options
  • Save alexandrejulien/11f4a90d62382e14bd5f91ab956442ee to your computer and use it in GitHub Desktop.
Save alexandrejulien/11f4a90d62382e14bd5f91ab956442ee to your computer and use it in GitHub Desktop.
A small command line script for updating in background Visual Studio or Programmed Task.
Write-Host "Update Visual Studio" -ForegroundColor Cyan
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
$startInfo.FileName = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe"
$startInfo.Arguments = "update --quiet --nocache --installPath ""C:\Program Files\Microsoft Visual Studio\2022\Enterprise"""
$process = New-Object System.Diagnostics.Process
$process.StartInfo = $startInfo
$process.Start()
$process.WaitForExit()
Write-Host "vs_installer.exe exited with code: $($vsUpdateProcess.ExitCode)" -ForegroundColor Green
Write-Host "End of VS Update" -ForegroundColor Green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment