Created
September 25, 2018 17:07
-
-
Save salaros/008bb75b28a347151e408d1a88c4ea87 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install-Module VSSetup -Scope CurrentUser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copied from: | |
# https://blogs.msdn.microsoft.com/heaths/2017/04/19/cleaning-up-the-visual-studio-2017-package-cache/ | |
param ( | |
[switch] $Cache | |
) | |
$start_args = if ($Cache) { | |
'repair', '--cache' | |
} else { | |
'modify', '--nocache' | |
} | |
get-vssetupinstance -all | foreach-object { | |
$args = $start_args + '--installPath', "`"$($_.InstallationPath)`"", '--passive', '--norestart' | |
start-process -wait -filePath "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vs_installer.exe" -args $args | |
if ($LASTEXITCODE -eq 3010) { | |
$REBOOTREQUIRED = 1 | |
} | |
} | |
if ($REBOOTREQUIRED) { | |
"Please restart your machine" | |
exit 3010 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment