Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use PowerShell for Visual Studio Command Prompt

Tags:

In a serious intiative to migrate all my command line operations to PowerShell, I would like to avoid using the old fashioned command console for anything. However, the Visual Studio Command prompt has various environment variables and path settings not found in the default command prompt. How could I create a 'Visual Studio PowerShell' with those same settings?

like image 599
ProfK Avatar asked Dec 09 '10 12:12

ProfK


People also ask

Can you use PowerShell in Visual Studio?

PowerShell Tools for Visual Studio is an extension you can install in Visual Studio to run PowerShell scripts. It provides a terminal, rich debugging tools and project system support.

How do I get the Visual Studio command prompt?

Start in Visual StudioOn the menu bar, select Tools > Command Line > Developer Command Prompt or Developer PowerShell.


2 Answers

You can use for example this script to import Visual Studio command prompt environment, see the examples in the script documentation comments, e.g. for Visual Studio 2010:

Invoke-Environment '"%VS100COMNTOOLS%\vsvars32.bat"' 

Having done that in the beginning of a PowerShell session (from your profile or manually), you get what you ask for in this PowerShell session.

Or you can use the solution provided by Keith Hill in this answer.

like image 112
Roman Kuzmin Avatar answered Oct 30 '22 15:10

Roman Kuzmin


have a look at PowerConsole

like image 21
Yoni H Avatar answered Oct 30 '22 15:10

Yoni H