How to get reference to the solution or projects in Init.ps1

Topics: General
May 1, 2013 at 11:08 AM
Hi all,

I an using NuGet 2.5 and Visual Studio 2010.

I want to execute the Init.ps1 script to copy a file to all projects (if it is not there).

The arguments I'm getting in Init.ps1 are:
param($installPath, $toolsPath, $package)

I need to get a reference to the solution object, so I can iterate through the projects and add the file to each.

Is there a way to get a solution reference from the Init.ps1 script?

Thanks,
Eyal
May 1, 2013 at 11:21 AM
Use $dte.Solution

Sent from my Windows Phone

From: [email removed]
Sent: ‎5/‎1/‎2013 4:09 AM
To: [email removed]
Subject: How to get reference to the solution or projects in Init.ps1 [nuget:442204]

From: eazran

Hi all,

I an using NuGet 2.5 and Visual Studio 2010.

I want to execute the Init.ps1 script to copy a file to all projects (if it is not there).

The arguments I'm getting in Init.ps1 are:
param($installPath, $toolsPath, $package)

I need to get a reference to the solution object, so I can iterate through the projects and add the file to each.

Is there a way to get a solution reference from the Init.ps1 script?

Thanks,
Eyal
May 2, 2013 at 8:46 AM
aha!

Remarkable, I didn't know EnvDte object was already populated

Thanks dotnetjunky!

Eyal