Skip to content

Instantly share code, notes, and snippets.

@michaelkc
Created January 25, 2022 11:19
Show Gist options
  • Save michaelkc/8fe69a0a8ad7d1de80f8c7a59f0b2607 to your computer and use it in GitHub Desktop.
Save michaelkc/8fe69a0a8ad7d1de80f8c7a59f0b2607 to your computer and use it in GitHub Desktop.
$vsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vsInstallerShell = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vs_installershell.exe"
$vsInstallPath = &$vsWhere -format json|convertfrom-json|select -expand installationPath
foreach ($installPath in $vsInstallPath)
{
$argumentList = "update --passive --norestart --force --installpath `"$installPath`""
Start-Process -FilePath $vsInstallerShell -ArgumentList $argumentList -wait
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment