The Find-Module cmdlet finds modules from the online gallery that match the specified criteria. Find-Module returns a PSGetItemInfo object for each module it finds, which you can be pipe to Install-Module to install.

If the RequiredVersion parameter is not specified, Find-Module returns the latest version of the module that is equal to or greater than the minimum version specified, or the newest version of the module if no minimum version is specified.

If the RequiredVersion parameter is specified, Find-Module only returns the version of the module that exactly matches the specified version. Find-Module searches through all available modules, because name conflicts between sources can occur.

Parameters

-AllVersions [<SwitchParameter>]

Specifies to include all versions of a module in the results. You cannot use the AllVersions parameter with the MinimumVersion, MaximumVersion, or RequiredVersion parameters.

-Command [<String[]>]

Specifies an array of commands to find in modules. A command can be a function or workflow.

-DscResource [<String[]>]

Specifies the name, or part of the name, of modules that contain DSC resources. Per Windows PowerShell conventions, performs an OR search when you provide multiple arguments.

-Filter [<String>]

Specifies a filter based on the PackageManagement provider-specific search syntax. For NuGet modules, this is the equivalent of searching by using the Search bar on the PowerShell Gallery website.

-IncludeDependencies [<SwitchParameter>]

Indicates that this operation includes all modules that are dependent upon the module specified in the Name parameter.

-Includes [<String[]>]

Returns only those modules that include specific kinds of Windows PowerShell functionality. For example, you might only want to find modules that include DSCResource. The acceptable values for this parameter are:

Specifies the maximum, or latest, version of the module to include in the search results. The MaximumVersion and the RequiredVersion parameters are mutually exclusive; you cannot use both parameters in the same command.

Specifies the names of one or more modules to search for. This parameter supports wildcard characters. If wildcard characters are not specified, only modules that exactly match the specified names are returned. If no matches are found, and you have not used any wildcard characters, the command returns an error. If you use wildcard characters, but do not find matching results, no error is returned.

-Repository [<String[]>]

Specifies the friendly name of a repository that has been registered by running Register-PSRepository.

Specifies the exact version number of the module to include in the results. The MinimumVersion and the RequiredVersion parameters are mutually exclusive; you cannot use both parameters in the same command.

-RoleCapability [<String[]>]

Specifies an array of role capabilities.

-Tag [<String[]>]

Specifies an array of tags. Example tags include DesiredStateConfiguration, DSC, DSCResourceKit, or PSModule.

This command returns a PSGetItemInfo object that represents the ContosoServer module from the online gallery.

Find similarly named modules:

PS C:> Find-Module -Name "Contoso*"

This example returns two PSGetItemInfo objects that represent the ContosoServer and ContosoClient modules from the online gallery.

Find a module by minimum version:

PS C:> Find-Module -Name ContosoClient -MinimumVersion 3.0.0.0

This example returns a PSGetItemInfo object that represents the newest version of the ContosoClient module that has a minimum version of at least 3.0.0.0. For example, if there is a version 4.0.0.0 ContosoClient module, that is included in the results of this command.

Find a module by specific version:

PS C:> Find-Module -Name "ContosoClient" -RequiredVersion 4.5.6.7

This example returns a PSGetItemInfo object that represents version 4.5.6.7 of the ContosoClient module. If the specified version 4.5.6.7 isn’t found, an error is returned.

Find a module in a specific repository:

PS C:> Find-Module -Name "Contoso" -Repository "myNuGetRepo"

This command returns a PSGetItemInfo object that represents the Contoso module from the myNuGetRepo module source. If the myNuGetRepo source wasn’t registered using the Register-PSRepository cmdlet, an error is returned.

This command returns PSGetItemInfo objects that represent modules that contain DSC resources and that match the filter App Domain. Because this example is operating against a NuGet-based repository, the Filter parameter searches through the name, description, and tags for the argument.

Additional Notes

This cmdlet runs on Windows PowerShell 3.0 or later releases of Windows PowerShell, on Windows 7 or Windows
2008 R2 and later releases of Windows.