Skip to content

Instantly share code, notes, and snippets.

@mill5james
Created November 5, 2018 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mill5james/a9f7c6175817fa7763e7a53ae067dc75 to your computer and use it in GitHub Desktop.
Save mill5james/a9f7c6175817fa7763e7a53ae067dc75 to your computer and use it in GitHub Desktop.
Visual Studio Vars in PowerShell
function VsDev {
pushd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools"
cmd /c "VsDevCmd.bat&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
Write-Host "`nVisual Studio 2017 Command Prompt variables set." -ForegroundColor Yellow
}
Set-Alias -Name VcVars -value VsDev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment