44

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

Daniel Elliott
  • 22,647
  • 10
  • 64
  • 82
  • 1
    I'm veeeeeeeery curious to see if someone's able to get a PowerShell prompt running inside VS2010, AND to see what VS-specific objects it has available to it. – Peter Seale Sep 29 '09 at 15:03

5 Answers5

42

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

knut
  • 4,699
  • 4
  • 33
  • 43
  • "This package manager is installed by default in Visual Studio 2010." - Is this really true? – Roman Kuzmin Jul 06 '11 at 09:43
  • I think so, I was trying to figure it out, but was unable to find any documentation. I'm speaking out of my own experience. I hope to confirm this. – knut Jul 06 '11 at 17:20
  • I thought I had to install NuGet after installing Visual Studio 2010. If I am wrong, please, forgive me for the false alarm. – Roman Kuzmin Jul 06 '11 at 17:46
  • Followup note: this IS a powershell window, but it will not load any of your personal profile scripts from the look of it...just garden-variety powershell – Jesse MacNett Jul 26 '19 at 16:29
8

There are two very interesting project available:

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

Serge van den Oever
  • 4,340
  • 8
  • 45
  • 66
  • 1
    Forget Power Console, the new kid on the block is NuGet (http://nuget.codeplex.com) which has the Power Console integrated. – Serge van den Oever Nov 30 '10 at 15:14
  • Actually these plugins work only for visual studio 2010 and up, while the question is clearly tagged with visual-studio-2008. – scigor Oct 02 '12 at 09:54
3

Check Out PowerShell Tools for Visual Studio. It adds language support for PowerShell in Visual Studio 2012 and 2013.

Tarun
  • 2,808
  • 3
  • 22
  • 21
2

Navigate to View -> Terminal.

lennoxGER
  • 284
  • 1
  • 6
1

I use the nuget package manager console as it's already installed in my IDE as part of nuget.

If you use a profile to set up your session environment, be aware that the Nuget profile script name is "NuGet_profile.ps1" located default in $Home\documents\WindowsPowerShell

One thing to be aware of when using PS in Visual Studio: VS is (currently) a 32 bit application and as such you will not be able to load or invoke the functionality of any 64 bit PS Modules - for instance the SqlServerManagementModules