Created
August 22, 2017 16:23
-
-
Save anderssonjohan/782dac800380c2342210c29f5da440d9 to your computer and use it in GitHub Desktop.
Import vsvars for VS 2017 Professional to set $env:VS150COMNTOOLS etc. Heavily based on https://github.com/Iristyle/Posh-VsVars/blob/8cb44c499a5da56db595a8ada085dba20998fce3/hanselman/Microsoft.PowerShell_profile%20-%20SAMPLE.ps1
This file contains hidden or 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
# Add this line to your profile.ps1 | |
. $PSScriptRoot\vsvars.ps1 |
This file contains hidden or 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 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