What do the $package and $project params contain in a NuGet install.ps1 script?
In NuGet 2:
- $project => EnvDTE.Project - which is the Visual Studio object model for a project.
- $package => NuGet.IPackage - the NuGet package.
In NuGet 3:
- $project => EnvDTE.Project
- $package => ScriptPackage
Note that the $package in NuGet 3 has a fewer properties available so some PowerShell scripts included with existing NuGet packages will not work.
You can always see which .NET Type a PowerShell variable is by using GetType().FullName
, e.g.:
Write-Output $project.GetType().FullNameWrite-Output $package.GetType().FullName