Powershell

How to install the PowerShellGet module in PowerShell?

The module “PowerShellGet” enables the users to install, update, or discover the software packages and modules from several resources. These resources include “NuGet” or a “PowerShell gallery”. PowerShell provides a method to interact with the PowerShellGet module because it is not the built-in feature of PowerShell. However, it can be integrated with this module.

The following post will elaborate on the PowerShellGet cmdlet in detail.

How to Install the PowerShell “PowerShellGet” Module?

The PowerShellGet module does not come pre-installed in Windows. However, it needs to be installed with the aid of several steps.

Step 1: Install NuGet

Execute the given command to install the “NuGet” tool which is a pre-requisite for installing the “PowerShellGet” module:

Install-PackageProvider -Name NuGet -Force

 
According to the stated code:

    • First, write the “Install-PackageProvider” cmdlet.
    • Then, provide the “-Name” parameter having the “NuGet” value assigned to it.
    • Lastly, mention the “-Force” parameter:

 

Step 2: Install PowerShellGet Module

Execute the given command to install the module “PowerShellGet”:

Install-Module -Name PowerShellGet -Force

 
In the stated code:

    • Firstly, specify the “Install-Module” module along with the “-Name” parameter having the “PowerShellGet” value assigned to it.
    • Then, place the “-Force” parameter:

 

Note: I have already installed the “PowerShellGet” module in my system. That’s why it is showing the above warning.

How to Get the Installed PowerShellGet Module?

The installed modules of PowerShellGet can be retrieved by executing the given line of code:

Get-Module -Name PowerShellGet -ListAvailable

 
To get the installed PowerShellGet Modules, first, specify the “Get-Module” cmdlet. Then, write the “-Name” parameter and assign it the “PowerShellGet” value. Lastly, mention the “-ListAvailable” parameter to get the available modules:


That was all about installing the “PowerShellGet” module in PowerShell.

Conclusion

To install the “PowerShellGet” module, first, install the “NuGet” module by executing the “Install-PackageProvider -Name NuGet -Force” command. After that, run the “Install-Module -Name PowerShellGet -Force” command to install the PowerShellGet module. This post explained the procedure of installing the PowerShellGet module in PowerShell.

About the author

Muhammad Farhan

I am a Computer Science graduate and now a technical writer who loves to provide the easiest solutions to the most difficult problems related to Windows, Linux, and Web designing. My love for Computer Science emerges every day because of its ease in our everyday life.