Powershell

How to Install and Update the PowerShellGet Module in PowerShell?

The “PowerShellGet” module contains the commands that are used to install, update, and publish packages like modules and scripts. It is a part of the “PowerShell Gallery” which stores all the PowerShell content. It is also integrated with the “PackageManagement” module which can also be used to install the modules in PowerShell.

The “PowerShellGet” module comes pre-installed on PowerShell. In case, it is missing then it can be installed by following this tutorial.

How to Install and Update the PowerShellGet Module?

Here is the list to install and update the PowerShellGet module:

Install PowerShellGet Module

To install the “PowerShellGet” module, go through the below-provided instructions.

Step 1: Check the Existing PowerShellGet Module’s Version

Execute the provided command to check if the “PowerShellGet” module is already installed in PowerShell or not:

Get-Module PowerShellGet

 
As it can be observed that the “PowerShellGet” module has been already installed:


Note: If the “PowerShellGet” module is not installed, then head over to step 2 to install it.

Step 2: Install the Module

To install the “PowerShellGet” module, first, use the “Install-Module” cmdlet along with the “-Force” and “-AllowClobber” parameters:

Install-Module PowerShellGet -Force -AllowClobber

 
Here:

    • -Force” parameter is used to install the module and overrides the existing installation.
    • -AllowClobber” parameter is used to override the warning messages regarding installation:

 

Update PowerShellGet Module

If the “PowerShellGet” module is already installed on the system, then it’s better to update it to the latest version by executing the following command:

Update-Module -Name PowerShellGet

 

That’s all! You have learned the procedure to install and update the “PowerShellGet” module in PowerShell.

Conclusion

To install and update the “PowerShellGet” module, first, check the version of the existing module by executing the “Get-Module PowerShellGet” command. After that, run the “Install-Module PowerShellGet -Force -AllowClobber” command to install and “Update-Module -Name PowerShellGet” to update it. This post elaborated on the installation of the “PowerShellGet” module.

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.