title | subtitle | author | date | source | notoc |
---|---|---|---|---|---|
PowerShellGet Commands |
PowerShell command examples to discover, install, update and publish PowerShell artifacts, and from the online PowerShell Gallery |
Jon LaBelle |
June 1, 2019 |
false |
PowerShellGet is a module with commands for discovering, installing, updating and publishing PowerShell artifacts like Modules, DSC Resources, Role Capabilities, and Scripts. --- PowerShellGet
The Find-Module finds modules in a repository that match specified criteria.
To find a module by name:
Find-Module -Name <module_name>
To find modules with similar name:
Find-Module -Name <some_name>*
To find a module by minimum version:
Find-Module -Name <module_name> -MinimumVersion <min_version_number>
To find a module by specific version:
Find-Module -Name <module_name> -RequiredVersion <version_number>
To find a module in a specific repository:
Find-Module -Name <module_name> -Repository PSGallery
To find a module that contains a DSC resource:
Find-Module -Repository PSGallery -Includes DscResource
To find a module using a filter:
The Filter parameter searches through the name, description, and tags for the specified argument.
Find-Module -Filter <argument>
The Install-Module downloads one or more modules from a repository, and installs them on the local computer.
To install the latest version of a module by name:
Install-Module -Name <module_name>
To install a specific version of a module:
Install-Module -Name <module_name> -RequiredVersion <version_number>
To install a module only for the current user:
Install-Module -Name <module_name> -Scope CurrentUser
To install a module for all users:
Install-Module -Name <module_name> -Scope AllUsers
The Update-Module downloads and installs the newest version of specified modules from an online gallery to the local computer.
To update all modules:
This example updates to the newest version all modules in $env:PSModulePath
that were installed by Install-Module
from the online gallery.
Update-Module
To update a module by name:
Update-Module -Name <module_name>
To update a module to a specified version:
Update-Module -Name <module_name> -RequiredVersion <version_number>
To update a module regardless of the current version installed:
Update-Module -Name <module_name> -Force
The Uninstall-Module cmdlet uninstalls the specified module from the local computer. You cannot uninstall a module if it has other modules as dependencies.
To uninstall a module by name:
Uninstall-Module -Name <module_name>
Get-InstalledModule gets installed modules on a computer.
To show a list of all installed modules:
Get-InstalledModule
- PowerShell Gallery -- The central repository for sharing and acquiring PowerShell code including PowerShell modules, scripts, and DSC resources.
- Documentation for All PowerShellGet Commands -- Complete and official documentation for all PowerShellGet commands.