Skip to content

Instantly share code, notes, and snippets.

@vrischmann
Created May 3, 2020 11:07
Show Gist options
  • Save vrischmann/0b4a187b9d2f4b586fde90df5659b9fe to your computer and use it in GitHub Desktop.
Save vrischmann/0b4a187b9d2f4b586fde90df5659b9fe to your computer and use it in GitHub Desktop.
PowerShell profiles that applies the vcvarsalls.bat file from Visual Studio 2019
pushd "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build"
# Adapt the argument `x86_amd64` if it's not what you need. Run the bat file to see what's available.
cmd /c "vcvarsall.bat x86_amd64 &set" |
foreach {
if($_ -match "(.*?)=(.*)")
{
Set-Item -force -path "ENV:\$($matches[1])" -value "$($matches[2])"
}
}
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment