Created
March 29, 2018 16:15
-
-
Save FeodorFitsner/b34162690ae2838409b7459824d51ed7 to your computer and use it in GitHub Desktop.
Calling vcvars from 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
if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2015") { | |
cmd.exe /c "call `"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd`" /x64 && call `"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat`" x86_amd64 && set > %temp%\vcvars.txt" | |
} else { | |
cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars.txt" | |
} | |
Get-Content "$env:temp\vcvars.txt" | Foreach-Object { | |
if ($_ -match "^(.*?)=(.*)$") { | |
Set-Content "env:\$($matches[1])" $matches[2] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment