My scenario is as follows:
I have a tool window which we call the "Factory Guide", this is a tree control with actions. These actions range from opening a certain document, adding a project, or runnin a test suite.
The "Factory Guide" currently has an embedded powershell host that provides access to the Visual Studio object model, just like the NuGet Package Manager Console.
http://solutionsfactory.macaw.nl/images/16-9/Factory%20Guide.png for a screenshot of the Factory Guide.
I would prefer to execute scripts in the NuGet Package Manager Console to execute my actions, because then I can distribute packages with functionality using NuGet.
I also would like to be able to get back results from scripts executed in the NuGet Package Manager Console so I can populate the Factory Guide with actions based on installed packages, and in this way provide a UI to available actions.
In order to do this I need one piece of functionality:
Execute a piece of powershell code in the context of the NuGet Package Manager Console, and get back the result.