PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

Install-Module from nupkg file

Open Jaykul opened this issue 7 years ago • 2 comments

It would be wonderful if PowerShell supported nupkg files natively (PowerShell/PowerShell#7259), but as a stop-gap (or perhaps, as part of the implementation of that), it would be really great if Install-Module had a parameter set where we just pass the path to a .nupkg file.

In fact, it would be great if you could associate powershell -c Install-Module "%1" -scope CurrentUser with the package extension, and people could then install modules on Windows by simply right-clicking and choosing Install as PowerShell Module...

NOTE: I think it would be important to also do PowerShell/PowerShellGet#794 while you were at it, to allow modules to more easily ship with multiple platform-specific implementations

Bonus points for making up your own file extension like .psmodule so we don't have the "Install as PowerShell Module" option on all our .nupkg files...

Jaykul avatar Jul 10 '18 17:07 Jaykul

We'd need to work out how dependencies work (search same directory only?). Also Update-Module would not know where the nupkg originally came from - seems unavoidable.

edyoung avatar Oct 02 '18 17:10 edyoung

I think this is really relevant also for offline scenarios. We have customers with secure internal networks without any internet. It is impossible to send them the nupkg or they just download them theyself from PSGallery and installing them manually. I do not see why dependency is an issue here: A dependency has to be fulfilled as before. If a dependency is not installed and can't be found in the configured repos, the installation fails and the customer has to install the dependency also manually.

bormm avatar Jul 13 '20 12:07 bormm