Bring back Update-DefaultProject

Sep 25, 2010 at 4:59 AM

Hey guys,

I would like to see Update-DefaultProject added back to the API.  It enables a great automation story where a project can be programatically added to a solution and then pacakges are installed.  I am able to do this using the internal powershell methods, but I think having this public api helps demonstrate what is really possible with NuPack.

I was able to replace the functionality of my old project http://SolutionFactory.codeplex.com with a few lines of powershell, I cannot convey how awesome this is.  What I needed to do as far as having to dive into the VS Addin api before was just a horrible experience and now, it is just so easy... I am going to wrap up the first 5 lines of powershell into what will be the new version of SolutionFactory which will just be a Solution level NuPack Package.  I am so stoked at how this will change what is possible.  The previous method of creating multi project templates was so broken and now it is going to be so easy, great work here!

$sln = Get-Interface $dte.Solution ([EnvDTE80.Solution2])
$templatePath = $sln.GetProjectTemplate("ClassLibrary.zip","CSharp")
$path = split-path $sln.filename
$sln.AddFromTemplate($templatePath, $path+"\tests","tests")
_SetDefaultProjectInternal "tests"
#update-defaultproject "tests"
add-package nunit
add-package moq 

Sep 25, 2010 at 5:06 AM

All of the commands have the -Project parameter which allows specifying the project explicitly. Does that not satisfy your needs?

Sep 25, 2010 at 5:15 AM

Yes, you should be able to do this today by passing -Project test to Add-Package. Also, there is a work item to add PowerShell commands to manage package sources; Update-DefaultProject isn't the right interface.

Sep 25, 2010 at 5:18 AM
You know.. I was just looking at the help on add-package and you are right on here,  I have everything I need. 
 
 I just need to read... or write the docs .  Thanks for not blasting me on this.. I am updating my  poc now.
Coordinator
Sep 25, 2010 at 5:19 AM

Yes, we need help writing docs. J I’ve been trying, but man, I can only do so much right now. ;)

Sep 25, 2010 at 5:22 AM

I almost think it's more important to get the help into -? on PowerShell ... that's more likely where folks are going to go get info on the commands.

Coordinator
Sep 25, 2010 at 5:28 AM

Yes! Might help to write up what these messages should be in the CodePlex wiki so we can all collaborate on them, and then put them into the PS script. Does that seem reasonable? We could have a page specifically for PS help messages.

Sep 25, 2010 at 10:30 PM

Here is the wiki page to start designing the help commands.  http://nupack.codeplex.com/wikipage?title=Powershell%20help%20commands