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:
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”:
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:
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.