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 Enter-VsEnv([string]$Arch = "amd64") { | |
| # 16.0 is the version number of vs2019, change it as you wish. | |
| $instanceId = (&"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -version 16.0 -property instanceId) | |
| $installationPath = (&"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -version 16.0 -property installationPath) | |
| Import-Module "$installationPath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" | |
| Enter-VsDevShell -InstanceId $instanceId -SkipAutomaticLocation -DevCmdArguments "-arch=$Arch" | |
| } |