Makes Visual Studio command line tools available in PowerShell. Supports Visual Studio 2015 and later versions.
Install posh-vs from the PowerShell Gallery:
PS> Install-Module posh-vs -Scope CurrentUser
Change your PowerShell profile to automatically import Visual Studio developer environment.
PS> Install-PoshVs
Start a new PowerShell session or reload your profile:
PS> . $profile
Use Visual Studio command line tools in PowerShell:
PS> msbuild /?
Install-PoshVs
adds an Import-VisualStudioEnvironment
call to the PowerShell
profile.
It will import the environment variables set by the VsDevCmd.bat
of the latest version of Visual Studio installed
on your computer. If multiple instances of Visual Studio are installed, Import-VisualStudioEnvironment
will use whichever instance happens to be listed first.
To use a specific instance of Visual Studio, manually change your profile to import a specific batch file.
Import-BatchEnvironment 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat'
Remove posh-vs from your PowerShell profile.
PS> Uninstall-PoshVs
PS> exit
Uninstall posh-vs from your computer.
PS> Uninstall-Module posh-vs
Install pre-requisites.
PS> .\init.ps1
Ctrl+Shift+B
to build and test in VSCode or
PS> Invoke-psake
F5
to debug tests in VSCode.
posh-vs was inspired by Alen Mack, StackOverflow contributors and posh-git.