The Find-Package cmdlet finds matching software packages that are available in package sources.

Parameters

-AllVersions [<SwitchParameter>]

Indicates that Find-Package returns all available versions of the package. By default, Find-Package only returns the newest available version.

-Command [<String[]>]

Specifies an array of commands for which this cmdlet searches.

-Credential [<PSCredential>]

Specifies a user account that has permission to search for packages.

-DscResource [<String[]>]

Specifies an array of Desired State Configuration (DSC) resources for which this cmdlet searches.

-Filter [<String>]

Specifies terms to search for within the Name and Description properties.

-Force [<SwitchParameter>]

Forces the command to run without asking for user confirmation.

-ForceBootstrap [<SwitchParameter>]

Indicates that this cmdlet forces Package Management to automatically install the package provider.

-IncludeDependencies [<SwitchParameter>]

Indicates that this cmdlet includes package dependencies in the results.

-Includes [<String[]>]

Specifies whether Find-Package should find all packages with DSC resources, cmdlets, functions, or workflows. The acceptable values for this parameter are:

— Cmdlet– DscResource– Function– Workflow

-MaximumVersion [<String>]

Specifies the maximum allowed version of the package that you want to find. If you do not add this parameter, Find-Package finds the highest available version of the package.

-MinimumVersion [<String>]

Specifies the minimum allowed version of the package that you want to find. If you do not add this parameter, Find-Package finds the highest available version of the package that also satisfies any maximum specified version specified by the MaximumVersion parameter.

-Name [<String[]>]

Specifies one or more package names, or package names with wildcard characters. Separate multiple package names with commas.

Specifies the exact allowed version of the package to find. If you do not add this parameter, Find-Package finds the highest available version of the provider that also satisfies any maximum version specified by the MaximumVersion parameter.

Outputs

Examples

This command finds all available Windows PowerShell module packages from galleries that are registered with the PSModule provider.

Find a package from a provider that is not yet installed:

PS C:> Find-Package -Name "Git" -Provider "Chocolatey"

This command first automatically installs the Chocolatey provider on the local computer, then searches for the Git package within that provider.

Find a package from a package source:

PS C:> Find-Package -Name "Git" -Source "ChocolateyRepository"

This command finds a package from a specified package source. This is a useful command if you know the name of the package source that you want to search, but are unsure about the package provider to which the source is registered. Without specifying a package source, Find-Package searches through all installed package providers and their package sources for a specified package. You can run Get-PackageSource -Location to get a package source name.

Find a package from a file system:

PS C:> Find-Package "C:temp"

This command finds packages from all installed PackageManagement package providers that are stored in the C:temp folder on the local computer.

Find a package with a specific name and version:

PS C:> Find-Package -Name "DSCAccel" -RequiredVersion "2.1.2"

This command finds version 2.1.2 of a package named DSCAccelerator. Although only part of the package name has been specified, Find-Package should be able to find the DSCAccelerator package if there are no other packages with a name matching that pattern.

This command finds a matching range of versions of a package named DSCAccelerator, by adding the MinimumVersion and MaximumVersion parameters to specify a range, and the AllVersions parameter to specify that all matching results within that range are returned as results.