Skip to content

Instantly share code, notes, and snippets.

@viniciusjarina
Created March 11, 2020 21:45
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 viniciusjarina/87e3bf71d1cea1a248f15f1f98720dd4 to your computer and use it in GitHub Desktop.
Save viniciusjarina/87e3bf71d1cea1a248f15f1f98720dd4 to your computer and use it in GitHub Desktop.
VS2017.ps1 to export VSDevCmd env vars to PowerShell
pushd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools"
cmd /c "VsDevCmd.bat&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment