How to use OneGet Package Manager in Windows 10

  Our previous article on Windows PowerShell provided a brief introduction to what Windows PowerShell is and how to use it. We hope it helped you get started with PowerShell. We also mentioned OneGet Package Manager which is a linux-style package management tool, and has been included in Windows 10 as a part of PowerShell. In this article, we’ll show you how to use OneGet Package Manager in Windows 10.

What is a Package Manager?

  If you’re familiar with linux, you probably know what package managers are and how they work. However, if you’ve never used any linux distribution aka distro, this term may be new for you. Anyway, we’re going to explain it.

  As a Windows user, you typically install software by downloading an .exe or .msi file from the internet and executing that file. However, on linux, things are dramatically different. On linux, you use special software typically referred to as the Package Manager. Different linux distros have different package managers. The Package Manager lets the user download various types of applications which have been developed particularly for that distro and version. For example, Ubuntu 16.04 has a special set of applications (aka repository) which have been developed primarily for that version. Similarly, Ubuntu 16.10 has different applications. Also, Mint, Fedora etc. have their own repositories. A package manager may be CLI-based or it may have graphical interface as well.

  This approach has several advantages. First of all, a user can install all types of software from one source, which is quite convenient. Second, there’s no risk of installing malicious software on your computer because everything comes from a trusted source. Third, there are no compatibility issues since the software has been developed for a particular OS and version. Fourth, updating an application becomes very easy because the package manager handles it automatically – and so on. The inclusion of a package manager on Windows is a great thing for users because it is very common for a Windows user to become a victim of malicious software.

How to use OneGet Package Manager in Windows 10

  So, now you know what a Package Manager is and how it works. Now, let’s discuss OneGet Package Manager. According to Microsoft,

OneGet is a new way to discover and install software packages from around the web. With OneGet, you can:
1. Manage a list of software repositories in which packages can be searched, acquired, and installed
2. Search and filter your repositories to find the packages you need
3. Seamlessly install and uninstall packages from one or more repositories with a single PowerShell command

Please Note that OneGet has been renamed to PackageManagement. Therefore, you need to type PackageManagement (and not OneGet) while using it in PowerShell. In this article, we’ll continue to use the term OneGet because it is short and more convenient to use.

  To view the list of available cmdlets for OneGet (or PackageManagement), run this command –

Get-Command -Module PackageManagement

How to use OneGet Package Manager in Windows 10

How to use OneGet Package Manager in Windows 10

  As you can see in the above image, the following cmdlets are available:

  1. Find-Package
  2. Find-PackageProvider
  3. Get-Package
  4. Get-PackageProvider
  5. Get-PackageSource
  6. Import-PackageProvider
  7. Install-Package
  8. Install-PackageProvider
  9. Register-PackageSource
  10. Save-Package
  11. Set-PackageSource
  12. Uninstall-Package
  13. Unregister-PackageSource

  The tasks performed by these cmdlets are pretty much obvious from their names. However, you can use Get-­Help <command> for getting more information about a particular cmdlet.

  While using these cmdlets, you might be prompted to install some package providers, such as NuGet or Chocolatey. In such cases, press ‘Y’ to install the provider. For example, refer to the image below:

Install Chocolatey

Install Chocolatey

  There’s one thing we’d like to clarify. So far, we have been referring to OneGet as a Package Manager. However, it’s actually a Package Manager Manager. In other words, it manages Package Managers such as Chocolatey. Windows does not have its own repository. Therefore, the applications you install come from other repositories such as Chocolatey. And you can use these third party package managers with Command Prompt as well. To learn how to use Chocolatey with CMD, read this article at PCWorld.

Leave a Reply

Your email address will not be published. Required fields are marked *