PackageManagement (OneGet) Package Manager in Windows 10

With Windows 10, Microsoft introduced PackageManagement, previously known as OneGet—a universal package manager that simplifies installing, updating, and uninstalling applications. Inspired by popular Linux tools like apt-get and yum, Microsoft aimed to bring similar capabilities to Windows users. In this article, we’ll explore the features and functionality of PackageManagement and how to use it to manage packages in Windows 10.

What is PackageManagement (OneGet)?

PackageManagement (OneGet) is part of the PowerShell application management platform, providing a unified interface for working with various package managers. With OneGet, users can work with applications from multiple repositories, installing, uninstalling, and updating them all through a single tool.

The primary advantage of PackageManagement is its support for multiple package sources, such as NuGet, Chocolatey, and others, allowing users to easily find and install the software they need. This makes OneGet a powerful solution for IT professionals and developers, enabling automation for software installation and updating processes in large-scale environments.

Installing and Configuring PackageManagement

PackageManagement is pre-installed in Windows 10 and accessible through PowerShell. To use it, open PowerShell with administrative privileges and run a few simple commands:

Get-Command -Module PackageManagement

This command displays a list of available PackageManagement commands, such as Find-Package, Install-Package, Uninstall-Package, and others.

Working with Repositories

PackageManagement allows you to add and configure multiple repositories. By default, it supports PSGallery, but you can add other sources, such as Chocolatey:

Register-PackageSource -Name "chocolatey" -ProviderName "Chocolatey" -Location "https://chocolatey.org/api/v2/"

You can now search for and install packages from this repository. Here’s an example of a package search:

Find-Package -Name "git"

This command searches for a package named "git" in the available repositories. To install it, simply use:

Install-Package -Name "git"

Installing, Updating, and Uninstalling Packages

With PackageManagement commands, you can easily handle package installation, updating, and removal:

  • Install-Package — installs a package from the specified repository.
  • Update-Package — updates an installed package to the latest version.
  • Uninstall-Package — removes an installed package.

For example, to update an installed package, simply enter:

Update-Package -Name "git"

This will update Git to the latest available version.