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