How to Install PowerShellGet


Ensure that you have a version of PowerShellGet and PackageManagement newer than installed. The latest stable versions are 2.2.5 for PowerShellGet and for PackageManagement.

If you're running Windows PowerShell 5.1 with PowerShellGet, see Update PowerShellGet for Windows PowerShell 5.1.

If you're running PowerShell 6.0 or later, you already have a newer version of PowerShellGet and PackageManagement installed. You can upgrade to a newer version if necessary or install the preview release. You should always install the latest stable release.

Use the following command to see what version is installed.

Get-Module PowerShellGet, PackageManagement

The following output shows that the latest stable version needs to be installed.

    Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version  Name               ExportedCommands
---------- -------  ----               ----------------
Binary  PackageManagement  {Find-Package, Get-Package, ...
Script  PowerShellGet      {Install-Module, Find-Module, ...

Install the latest stable release

To install the latest versions of these modules run the following:

Install-Module PowerShellGet -Force -AllowClobber

Install the Preview release

To install this preview release side-by-side with your existing PowerShellGet version, open any PowerShell console and run:

Install-Module PowerShellGet -AllowClobber -AllowPrerelease