Created
April 14, 2022 07:41
-
-
Save voidbar/025f707dbc1f3039bcd9f12ef9389330 to your computer and use it in GitHub Desktop.
Modern MSVC open developer shell script using 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
# Require `Install-Module VSSetup -Scope CurrentUser` | |
function vsdev | |
{ | |
param( | |
[int] $Version = 16 # VS 2019 | |
) | |
$vspath = Get-VSSetupInstance | where { $_.InstallationVersion.Major -eq $Version } | select -first 1 -ExpandProperty InstallationPath | |
Import-Module "$vspath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" && Enter-VsDevShell -VsInstallPath $vspath -SkipAutomaticLocation -DevCmdArguments '-arch=x64' | |
} | |
# ❯ vsdev 16 | |
# ********************************************************************** | |
# ** Visual Studio 2019 Developer PowerShell v16.11.11 | |
# ** Copyright (c) 2021 Microsoft Corporation | |
# ********************************************************************** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment