Cyberithub

How to Search/Find a PowerShell Module in Repository

Advertisements

In this article, we will see how to search/find a powershell module in repository. Often, when we have to install a PowerShell module, we always first check and verify its availability in repository using Find-Module cmdlet. Using this cmdlet, we can search the exact version that we need for our requirement from the registered repository. There are multiple options available with Find-Module cmdlet that we can use to further refine our search and find exactly what we need. We will see all those options with the help of examples in below section. You can check more about Find-Module on Microsoft official website.

 

How to Search/Find a PowerShell Module in Repository

How to Search/Find a PowerShell Module in Repository

Also Read: How to Format PowerShell Command Output as List

If you are looking for latest available version then you can use Find-Module -Name <Module_Name> command to search the module in repository. For example, here we are searching pscx module using Find-Module -Name pscx command as shown below.

PS C:\> Find-Module -Name pscx

Version  Name     Repository  Description
-------  ----     ----------  -----------
3.3.2    Pscx     PSGallery   PowerShell Community Extensions (PSCX) base modu...

If you are looking for some specific version say 3.3.0, then you need to use Find-module -Name pscx -RequiredVersion 3.3.0 command as shown below.

PS C:\> Find-Module -Name pscx -RequiredVersion 3.3.0

Version  Name     Repository  Description
-------  ----     ----------  -----------
3.3.0    Pscx     PSGallery   PowerShell Community Extensions (PSCX) base module which implements a general purpose set of Cmdlets.

If you want to check all the available versions then you need to use Find-Module -Name pscx -AllVersions command as shown below.

PS C:\> Find-Module -Name pscx -AllVersions

Version   Name     Repository   Description
-------   ----     ----------   -----------
3.3.2     Pscx     PSGallery    PowerShell Community Extensions (PSCX) base modu...
3.3.1     Pscx     PSGallery    PowerShell Community Extensions (PSCX) base modu...
3.3.0     Pscx     PSGallery    PowerShell Community Extensions (PSCX) base modu...
3.2.2     Pscx     PSGallery    PowerShell Community Extensions (PSCX) base modu...
3.2.1.0   Pscx     PSGallery    PowerShell Community Extensions (PSCX) base modu...
3.2.0.0   Pscx     PSGallery    PowerShell Community Extensions (PSCX) base modu...
3.1.0.0   Pscx     PSGallery    PowerShell Community Extensions (PSCX) base modu...

If you are looking for module's minimum version and if the repository contains the newer version then it will display the latest available version as shown below. For example, here we are searching for the minimum version 3.1.0 using Find-Module -Name pscx -MinimumVersion 3.1.0 command but the latest one available in repository is 3.3.2 so it is currently showing on the output.

PS C:\> Find-Module -Name pscx -MinimumVersion 3.1.0

Version  Name      Repository  Description
-------  ----      ----------  -----------
3.3.2    Pscx      PSGallery   PowerShell Community Extensions (PSCX) base module which implements a general purpose set of Cmdlets.

If you want to search/find module in a specific repository instead in all available repository then you need to specify the name of that repository. For example, here we are searching module pscx in PSGallery repository using Find-Module -Name pscx -Repository PSGallery command as shown below.

PS C:\> Find-Module -Name pscx -Repository PSGallery

Version  Name    Repository  Description
-------  ----    ----------  -----------
3.3.2    Pscx    PSGallery   PowerShell Community Extensions (PSCX) base module which implements a general purpose set of Cmdlets.

To check all the currently registered module repositories, you can use Get-PSRepository cmdlet as shown below.

PS C:\> Get-PSRepository

Name          InstallationPolicy  SourceLocation
----          ------------------  --------------
PSGallery     Untrusted           https://www.powershellgallery.com/api/v2

You can also search module by a tag. For example, here we are searching all the modules created with tag CrescendoBuilt using Find-Module -Tag CrescendoBuilt command as shown below.

PS C:\> Find-Module -Tag CrescendoBuilt

Version  Name                           Repository  Description
-------  ----                           ----------  -----------
0.3.0    Foil                           PSGallery   A PowerShell Crescendo wrapper for Chocolatey
0.4.0    Cobalt                         PSGallery   A PowerShell Crescendo wrapper for WinGet
0.2.1    Microsoft.WinGet.Client        PSGallery   PowerShell Module for the Windows Package Manager Client. Due to https://github.com/PowerShell/PowerShellGet/issues/8...
1.1.0    SysInternals                   PSGallery   PowerShell cmdlets for SysInternal tools
0.0.5    Croze                          PSGallery   A PowerShell Crescendo wrapper for Homebrew
1.0.2    Takeown                        PSGallery   Crescendo Powershell wrapper of takeown.exe
1.0.1    SpeedTest-CLI                  PSGallery   PowerShell cmdlets for Internet Speed Test
1.0.1    RoboCopy                       PSGallery   PowerShell cmdlet for the official RoboCopy.exe
1.0.1    pastel                         PSGallery   PowerShell commands for pastel
0.0.2    AptPackage                     PSGallery   PowerShell Crescendo-generated Module to query APT-Package Information
1.0.2    TShark                         PSGallery   PowerShell cmdlet for tshark.exe
1.0.0    SpeedTestCLI                   PSGallery   PowerShell cmdlets speedtest-cli
0.1.3    Quser.Crescendo                PSGallery   This module displays session information of users logged onto a local or remote machine using the Windows native appl...
0.0.2    PSLogParser                    PSGallery   Crescendo Powershell module for Log Parser 2.2
1.0.2    Image2Text                     PSGallery   PowerShell Images into ASCII art
0.8.0    VssAdmin                       PSGallery   This is a Crescendo module to wrap the Windows `vssadmin.exe` command-line tool.
0.0.1    PSDupes                        PSGallery   A crescendo module to locate duplicate files. Very fast and easy to use, progress is shown whilst searching
0.1.0    psFilesCli                     PSGallery   A PowerShell wrapper for files-cli.exe
0.1.4    PSConfig.Crescendo             PSGallery   PowerShell cmdlets for SharePoint PSConfig tool wrapped with MS Crescendo.

Similarly, you can search/find a module with a filter. For example, if you are looking for all the modules with Filter carbon then you need to use Find-Module -Filter carbon command as shown below.

PS C:\> Find-Module -Filter carbon

Version   Name                           Repository  Description
-------   ----                           ----------  -----------
2.14.1    Carbon                         PSGallery   Carbon is a PowerShell module for automating the configuration Windows 7, 8, 2008, and 2012 and automation the instal...
2.0.0     Carbon.Windows.Installer       PSGallery   The Carbon.Windows.Installer module is a Windows-only module that has functions for reading and installing Windows MS...
1.2.0     Carbon.Core                    PSGallery   Functions that make doing things in PowerShell a little easier. We think these should be part of PowerShell itself. C...
3.1.3     Carbon.Cryptography            PSGallery   Makes encrypting and decrypting strings and other security work easy.
1.0       CarbonBlackPS                  PSGallery   PowerShell module for Carbon Black administration via the Carbon Black API
1.0.0     Carbon.Windows.HttpServer      PSGallery   PowerShell module for managing the Windows HTTP server: getting and setting HTTPS/TLS/SSL certificate bindings to IP ...
1.0.1     Carbon.IIS                     PSGallery   Carbon.IIS is a module for installing and managing IIS app pools, websites, applications, and configuring other parts...
1.0.1     Carbon.FileSystem              PSGallery   The Carbon.FileSystem module currently only has one function, Get-FileHardLink, which is used to...
1.2.0     Power-Cbr                      PSGallery   A PowerShell module library for interating with Carbon Black EDR (né Carbon Black Response).
1.1.0     CarbonAwareComputing           PSGallery   A Powershell Cmdlet to get the best execution time for a tasks with carbon awareness in mind. The best point in time ...

If you are looking for all the modules containing some specific keyword, say bicep in our case then you need to use Find-Module -Name *bicep* command as shown below.

PS C:\> Find-Module -Name *bicep*

Version  Name                     Repository    Description
-------  ----                     ----------    -----------
2.3.3    Bicep                    PSGallery     A module to run Bicep using PowerShell. The module is a community project built using the Bicep assemblies to provide...
1.0.6    AzureBicep               PSGallery     Powershell Functions for use with Bicep to deploy Azure Resources
1.1.1    BicepDev                 PSGallery     A module for converting parameters and variables in Bicep templates to outputs
0.0.1    BicepTest                PSGallery     Test Framework for Bicep
2.0.10   BicepNet.PS              PSGallery     A thin wrapper around bicep that will load all Bicep assemblies in a separate context to avoid conflicts with other m...
0.0.1    BicepTester              PSGallery     Test
0.1.1    PSBicepParser            PSGallery     Powershell parser for Azure Bicep files. It makes easier parsing Bicep files. To be used in CI/CD pipeline that needs...
0.2.4    PSBicepApiManagement     PSGallery     Powershell module to export/import a single api from Azure Api Management using Azure Bicep.

If you are looking for all the modules which starts with certain keyword say prism in our case then you need to use Find-Module -Name prism* command as shown below.

PS C:\> Find-Module -Name prism*

Version   Name           Repository  Description
-------   ----           ----------  -----------
0.6.0     Prism          PSGallery   Prism is a PowerShell module manager inspired by NuGet. Run `prism install` in a source code repository, and Prism wi...
1.5.1     PrismShell     PSGallery   Cmdlets to interact with your Prism 3D printer

Similarly, if you are searching for all the modules which ends with certain keyword, say psql in our case then you need to use Find-Module -Name *psql command as shown below.

PS C:\> Find-Module -Name *psql

Version   Name              Repository  Description
-------   ----              ----------  -----------
2.1.0     PSql              PSGallery   Provides basic cmdlets to connect and invoke commands against SQL Server and Azure SQL databases.
1.103.8   PowerUpSQL        PSGallery   PowerUpSQL is an offensive toolkit designed for attacking SQL Server. The PowerUpSQL module includes functions that ...

Finally, you can also find a powershell module in multiple repository. For example, if you are looking for all the modules that start with the keyword Contoso in repositories PSGallery and MyRepo then you need to use Find-Module -Name Contoso* -Repository PSGallery, MyRepo command as shown below.

PS C:\> Find-Module -Name Contoso* -Repository PSGallery, MyRepo

Leave a Comment