Back to Blog
We now need to find a way to strip off the filename to get the folder. We can ask this for the path of the loaded solution: PM> $ There is a variable called $dte which is a COM object allowing automation of the VS development environment. Sadly, there seemed to be none containing the path of the loaded solution, but asking a question on StackOverflow pointed me in the right direction. This will show the names and current values of all variables. The first thing I discovered was that you can query PowerShell for all the variables that are available using the Get-Variable command. So, despite knowing virtually nothing about PowerShell, I set about working out how I could automate this process. There was just one slight snag, and that is that the current working directory of the Package Manager Console seems to default to your user account: PM> pwd For example, I use Mercurial on a number of my applications, so it allows me to input commands such as hg add or hg commit directly within the console window. It is a fully working PowerShell window and all the commands on your path are also available. The great thing about this window is that it can be used for more than just nupack commands. When you install nupack (which seems likely to be renamed nuget in the near future), you get a new dockable Visual Studio 2010 window called the Package Manager Console which allows you to run nupack commands right from within VS2010.
0 Comments
Read More
Leave a Reply. |