Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Make using NuGet packages installed with Install-Package easier to use - make Add-Type support NuGet packages #6724
#6679 (comment) shows how hard it is to use a NuGet package installed via
Therefore, it would be great if
# Install a NuGet package from the NuGet Gallery and add its types to the session. Install-Package -Provider nuget Mono.Posix.NETStandard | Add-Type # Add the types of an already installed NuGet package to the session. Add-Type -Package Mono.Posix.NETStandard # Equivalent, via Get-Package. Get-Package Mono.Posix.NETStandard | Add-Type
That is, when given a NuGet package [name],
Written as of:
PowerShell Core v6.0.2
referenced this issue
Apr 24, 2018
Would love this. Coming from Cake Build this was so easy with https://cakebuild.net/docs/fundamentals/preprocessor-directives. Given the widespread usage of nuget and likely need to leverage that from PS Core scripts it would seem this would be supported as a first class citizen.
While PSGallery modules can be installed with
Is that what you were asking?
While #7259 has the same goal in the abstract - making use of NuGet package easier - it is a competing proposal in terms of implementation.
I don't think it's appropriate to integrate the functionality into
In short: My vote is to implement this issue only, instead of #7259.
Yes, all compiled cmdlets come as part of assemblies, but they're typically packaged as part of a PS module.
(Install-Package "SomePackage" | Add-Type -PassThru).Assembly | Import-Module
But it sounds like we're in agreement then, correct?:
No changes to