Once called ‘OneGet’, PowerShell Package Manager is a module that comes with PowerShell v5 that saves a ton of time installing, uninstalling, and maintaining software. Here is how to use it in Windows 10 systems.
With Windows 10 being released, there is a brand new version of PowerShell out too: PowerShell version 5. And, also along with PowerShell v5, a lot of new features came which will help IT professionals save time and will help us to do our jobs more efficiently. One of these exciting features that we have been using a lot is called PowerShell Package Manager.
PowerShell Package Manager will allow you to find, install, and remove software all from inside PowerShell from various repositories on the internet, and without needing to search around the internet or your network to find software installers. Even better, you will not need to worry about how you can silently install the software, either. All of this functionality is built into PowerShell v5.
Let’s go over how to get started using the PowerShell Package Manager in Windows 10.
Packages are usually served up by package providers which are made from multiple sources. By default, PowerShell arrives with two package sources: ‘nugget.org’ and ‘PSGallery’. You can retrieve a list of every source configured by using the Get-PackageSource ‘cmdlet’.
Providers are then built from sources.
If you want to see a list of providers available, you will be able to use the Find-PackageProvider ‘cmdlet’. This should give you a list of every provider registered with PowerShellget.
Knowing where the packages come from is good information, but if you are just starting with PowerShell Package Manager, I’m sure the first things you want to see are the available packages. To do that, you can use the Find-Package ‘cmdlet’. This ‘cmdlet’ will search every provider available registered and will return a long list of all the packages available to install.
Let’s say that you would like to install the Nancy package. You would first use Find-Package to see if it is available.
We will see that the version 1.4.3 is available to me from the ‘nugget.org’ source,which is the most recent version from the time this guide was made.
To install this, you can pipe this directly to the install-package ‘cmdlet’.
However, keep in mind that we got an error message which indicates a problem, telling us that this specific package will not allow install without the use of the Destination parameter on Install-Package. You will find packages to have different requirements like this.
To get Nancy installed, you will need to tell Install-Package where to install this Package. We will go for ‘C:Nancy’.
Because this package source was not marked as trusted, you will receive a confirmation warning. You will confirm that this is OK to do and it will then continue the installation. Notice after it is finished, you will then have a Nancy folder and the package will be installed.
If you attempted to do a silent install software before, then you know that this approach is far simpler than before. It is simply a matter of finding the software you want to install and getting it done.
If you want to include custom software into PowerShell Package Manager, you will have to package it up using ‘nugget’. Even though it isn’t nearly as easy as installing pre-existing packages, after you learn the packaging process, it won’t be too difficult to script the process.
How To Use PowerShell Package Manager In Windows 10
Updated on January 9, 2019