Skip to content

Instantly share code, notes, and snippets.

View ChanthMiao's full-sized avatar
😴

Changwei Miao ChanthMiao

😴
  • UOS/Deepin
  • [IX]
View GitHub Profile
@ChanthMiao
ChanthMiao / Microsoft.PowerShell_profile.ps1
Created January 19, 2020 15:48
Activate vs dev environment in powershell
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"
}