Created
November 5, 2018 13:08
-
-
Save mill5james/a9f7c6175817fa7763e7a53ae067dc75 to your computer and use it in GitHub Desktop.
Visual Studio Vars in PowerShell
This file contains 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
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