How do I get Nuget 2.x to run solution level package Init.ps1's?

Topics: General
Oct 11, 2012 at 2:51 AM

I have a few solution level NuGet packages attached to a Visual Studio 2010 solution via .nuget/packages.config.

These packages each contain a Init.ps1 file. I'm trying to pre-install the packages via commandline or script on my CI server. Running nuget install .nuget\packages.config -o packages pulls the packages down into the packages folder. But it does not run the Init.ps1 scripts.

If I attempt and msbuild call on the solution file, it fails because required files installed by the package Init.ps1 files are not in place yet.

If I open up the solution in Visual Studio, the packages run Init.ps1.

How can I get the Init.ps1 files to fire along with the package install from a commandline/script without having to open Visual Studio?

Oct 12, 2012 at 5:16 PM
Edited Oct 12, 2012 at 5:16 PM

There's no way the command line can run the init.ps1 script. Doing so requires a PowerShell host, and the command line is not a host.