Product and service reviews are conducted independently by our editorial team, but we sometimes make money when you click on links. Learn more.
 

How To Use PowerShell Package Manager In Windows 10

How To Use PowerShell Package Manager In Windows 10
By

Once called OneGet, PowerShell Package Manager is a module that comes with PowerShell v5 that saves a ton of time installing, uninstall and maintain software. Here's how to use it in Windows 10 systems.

With the release of Windows 10 came a brand new version of PowerShell as well: PowerShell version 5. And as part of PowerShell v5 came a lot of new features that help IT professionals save time and do our jobs more efficiently. One of those exciting features that I've been using a lot is called PowerShell Package Manager. 

PowerShell Package Manager allows you to find, install and remove software all from within PowerShell from various repositories on the Internet and without having to search around the Internet or your network to find software installers. Even better, you don't have to worry about how to 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.

MORE: PowerShell Tutorials
MORE: Windows 10 Tutorials

Packages are served up by package providers, which are created from various sources. By default, PowerShell comes with two package sources: nuget.org and PSGallery. You can get a list of all configured sources by using the Get-PackageSource cmdlet.

Providers are then built from sources. To get a list of available providers, you can use the Find-PackageProvider cmdlet. This will give you a list of all providers registered with PowerShellGet.

Knowing where the packages come from is good information but if you're just starting with PowerShell Package Manager, I'm sure the first thing you want to see are the available packages. To do this, you can use the Find-Package cmdlet. This cmdlet searches all of the available providers registered and returns a huge list of all of the available packages to install.

Let's say that I'd like to install the Nancy package. I'd first use Find-Package to see if it is available.

I can see that version 1.4.3 is available to me from the nuget.org source. This is the most recent version.

To install this, I can pipe this directly to the Install-Package cmdlet.

However, notice that I got an error message indicating a problem. It's telling me that this particular package won't allow install without the use of the Destination parameter on Install-Package. You'll find packages have different requirements like this. To get Nancy installed, I'll need to tell Install-Package where to install this package. I'll choose C:Nancy.

Since this package source was not marked as trusted, I will receive a confirmation warning. I'll confirm that this is OK to do and it will then proceed to do the installation. Notice after it is done, I now have a C:Nancy folder and the package has been installed.

If you've tried to silent install software in the past you know that this approach is far easier than before. It's simply a matter of finding the software you need to install and getting it done.

If you'd like to include custom software into PowerShell Package Manager, you'll need to package it up using nuget. Although, not nearly as easy as installing preexisting packages, once you learn the packaging process it shouldn't be too difficult to script the process.

RELATED: