How can I use PowerShell with the Visual Studio Command Prompt? -


I am using beta 2 for a while and making me crazy that I am CMD.ax when the VS2010 command Prompt is running. I was making a good makeover 2008.ps1 script for Visual Studio 2008. Does anyone have a vsvars2010.ps1 or something similar?

Stolen generously from here: I was able to work it out. I added the following to my profile .ps1 and it is well with the world.

  pushd 'c: \ program files (x86) \ Microsoft Visual Studio 10.0 \ VC' cmd / c "vcvarsall.bat and set" | Forex currency {if ($ _-- match "=") {$ v = $ _ Divided ("="); Set-item -force-path "ENV: \ $ ($ v [0])" -value "$ ($ v [1])"}} popd write-host "` nVisual Studio 2010 set command prompt variable. "- Forgreen Color Yellow  

It worked well for years - Visual Studio 2015. vcvarsall.bat no longer exists unless you can use vsvars32.bat file Is located in the Common7 \ Tools folder.

  pushd 'C: \ Program Files (x86) \ Microsoft Visual Studio 14.0 \ Common7 \ Tools' cmd / c "vsvars32.bat and set" | Forex currency {if ($ _-- match "=") {$ v = $ _ Divided ("="); Set-item -force-path "ENV: \ $ $ $ [[0])" -value "$ ($ v [1])"}} popd write-host "` nVisual Studio 2015 set command prompt variable. "- Forgreen Color Yellow  

Things have changed for Visual Studio 2017 again. vsvars32.bat to VsDevCmd.bat . The exact path can vary depending on the visual studio 2017 you are using.

Push "C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Enterprise \ Common7 \ Tools" cmd / c "VsDevCmd.bat and set" | Forex currency {if ($ _-- match "=") {$ v = $ _ Divided ("="); Set-item -force-path "ENV: \ $ ($ v [0])" -value "$ ($ v [1])"}} popd write-host "` nVisual Studio 2017 set command prompt variable. "- ArthmandCollar Yellow

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -