Skip to content

Instantly share code, notes, and snippets.

@shanselman
Created December 11, 2018 01:23
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 shanselman/35734b5c6bf5d03f6c84bebfb6905932 to your computer and use it in GitHub Desktop.
Save shanselman/35734b5c6bf5d03f6c84bebfb6905932 to your computer and use it in GitHub Desktop.
PowerShell Profile addition to take VSVars and make it automatic in PS1
pushd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment