I am wondering when its appropriate to use Install-Package and Install-Module.
I have an internal PowerShell repository which I publish myown modules to. Install-Package will work with it, Install-Module doesn't.
Thus my understanding had been that Install-Package uses all registered providers. Install-Module seems to be just for online repositories such as PSGallery.
I can find and install Pester with both.
C:\> install-package pester WARNING: Version '3.4.0' of module 'Pester' is already installed at 'C:\Program Files\WindowsPowerShell\Modules\Pester\3.4.0' . . . C:\> install-module pester WARNING: Version '3.4.0' of module 'Pester' is already installed at 'C:\Program Files\WindowsPowerShell\Modules\Pester\3.4.0' . . .
But what is confusing me is PoshRSJobs was only available with Find-Module/Install-Module.
C:\> Find-Package poshrsjobs Find-Package : No match was found for the specified search criteria and package name 'poshrsjobs'. C:\> Find-Module poshrsjob 18.104.22.168 PoshRSJob PSGallery Module designed to . . .
I've searched around and looked at the help files to see what the use cases are for each but can't find an answer.
So... Install-Package is part of the lower-level PowerShell Package Manager. It does indeed use any available provider. Install-Module, on the other hand, is a very specific implementation that rides atop PowerShell Package Manager. It works only with providers that look and feel like PowerShell Gallery. That can be a private gallery.
PPM can potentially install any kind of software; Install-Module only installs PowerShell artifacts.
Thanks Don, that confirms my understanding.
I found this also.
My confusion over why Find-Package could not find the module was down to a typo.
C:\> Find-Package poshrsjobs
It should have been PoshRSJob not PoshRSJobs
You must be logged in to reply to this topic.