Skip to content

Instantly share code, notes, and snippets.

@anderssonjohan
Created August 22, 2017 16: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 anderssonjohan/782dac800380c2342210c29f5da440d9 to your computer and use it in GitHub Desktop.
Save anderssonjohan/782dac800380c2342210c29f5da440d9 to your computer and use it in GitHub Desktop.
# Add this line to your profile.ps1
. $PSScriptRoot\vsvars.ps1
function Get-Batchfile ($file) {
$cmd = "`"$file`" & set"
cmd /c $cmd | Foreach-Object {
$p, $v = $_.split('=')
Set-Item -path env:$p -value $v
}
}
Get-Batchfile "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsMSBuildCmd.bat"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment