Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell inside Visual Studio

Does anyone know of a way I can run a powershell within Visual Studio.

By that I mean, have an interactive powershell prompt in a tool window?

Kindness,

Dan

like image 455
Daniel Elliott Avatar asked Sep 29 '09 06:09

Daniel Elliott


People also ask

Can you use PowerShell in Visual Studio?

Visual Studio Code with the PowerShell extension is the recommended editor for writing PowerShell scripts. It supports the following PowerShell versions: PowerShell 7.0 and higher (Windows, macOS, and Linux)

How do I show PowerShell in Visual Studio?

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

How do I run a PowerShell script in Visual Studio?

Once it is saved as a PS1, VS Code will identify the file as a PowerShell script. From there, you can execute the PowerShell script by press F5 . You can also click the Run button on the top right of the editor. To run a select, you can press F8 or right click on the selection and click the Run Selection option.


2 Answers

The NuGet Package Manager has a NuGet Package Manager Console which is a PowerShell host. Open the console by clicking Tools > Library Package Manager > Package Manager Console.

The package manager is automatically installed in Visual Studio 2010 when you install ASP.NET MVC 3. You can install ASP.NET MVC 3 using the Microsoft Web Platform Installer. You can also install NuGet by using the Visual Studio Extension Manager.

Quoted from the ASP.NET web site:

ASP.NET MVC 3 automatically installs and enables NuGet as part of its setup. NuGet is a free open-source package manager that makes it easy to find, install, and use .NET libraries and tools in your projects. —http://www.asp.net/mvc/mvc3#overview

like image 133
knut Avatar answered Sep 24 '22 06:09

knut


There are two very interesting project available:

  • A powershell command shell called Power Console: http://visualstudiogallery.msdn.microsoft.com/en-us/67620d8c-93dd-4e57-aa86-c9404acbd7b3

  • The integration of the PowerGui script editor (the best!) into Visual Studio: http://powerguivsx.codeplex.com/

Check them out, together they will fulfill all you needs:-)

like image 20
Serge van den Oever Avatar answered Sep 23 '22 06:09

Serge van den Oever