title: Creating a Visual Studio 2013 extension that hosts PowerShell
body: <p>Much of my build process is a collection of PowerShell scripts and functions, all defined within a <code>.ps1</code> file.  I simply have a shortcut to that file on my desktop, and it launches PowerShell and initializes everything.</p>
  
  <p>Now, I think it would be handy if I could just run that shell <em>within</em> the Visual Studio 2013 environment.  That way, I wouldn't need to keep switching windows when I want to build, publish things to IIS, perform database provisioning, etc.  Should be easy enough, right?</p>
  
  <p>The first thing I found was <a href="http://visualstudiogallery.msdn.microsoft.com/67620d8c-93dd-4e57-aa86-c9404acbd7b3" rel="nofollow">PowerConsole</a>, an extension for Visual Studio that allows users to access Power Shell from within VS.  However, it only works with Visual Studio 2010.  <a href="http://visualstudiogallery.msdn.microsoft.com/67620d8c-93dd-4e57-aa86-c9404acbd7b3/view/Discussions#5953" rel="nofollow">According to the author</a>, the NuGet team basically forked his code and it's now part of the NuGet console.  So, my next idea was to just use the NuGet console.  This has a few problems:</p>
  
  <ol>
  <li>It's called the "Package Manager Console" and hidden away in some menu.  I want something easy to get to and clear that it's a build environment for my product.</li>
  <li>While you can run PowerShell commands such as <code>dir</code>, it doesn't really behave like PowerShell.  For example, you can't change the prompt, even if you override the <code>prompt</code> function.</li>
  <li>There doesn't seem to be a way to override the profile.  When I run my <code>BuildShell.ps1</code> file, none of the functions within the file are registered and nothing seems to change.</li>
  </ol>
  
  <p>Overall, this seems like a hacky way to integrate a custom build environment into Visual Studio.  So, next step is to create my own extension.  After all, that's all NuGet is, right?</p>
  
  <p><strong>The Question:</strong></p>
  
  <p>How do you create a <em>NuGet</em> like extension for Visual Studio 2013?  MSDN has quite a few <a href="http://msdn.microsoft.com/en-us/library/bb458154.aspx" rel="nofollow">Visual Studio 2013 Extension samples</a>, however they seem to be geared around extending the editor (such as what reSharper might do) and not creating new command windows.  I'm looking for something to get me started, or perhaps an open source program I can look at.  Thanks!</p>