Find-Package

Finds software packages in available package sources.
Find-Package [[-Name] [<String[]>]] [-AllVersions] [-Command [<String[]>]] [-Credential [<PSCredential>]][-DscResource [<String[]>]] [-Filter [<String>]] [-Force] [-ForceBootstrap] [-IncludeDependencies] [-Includes{DscResource | Cmdlet | Function | Workflow}] [-MaximumVersion [<String>]] [-MinimumVersion [<String>]][-PackageManagementProvider [<String>]] [-ProviderName {Programs | msi | msu | PowerShellGet | nuget |chocolatey}] [-PublishLocation [<String>]] [-RequiredVersion [<String>]] [-ScriptPublishLocation [<String>]][-ScriptSourceLocation [<String>]] [-Source [<String[]>]] [-Tag [<String[]>]] [-Type {Module | Script | All}][<CommonParameters>]

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.

-PackageManagementProvider [<String>]

Specifies the name of the Package Management provider.

-ProviderName [<String[]>]

Specifies one or more package provider names. Separate multiple package provider names with commas.

-PublishLocation [<String>]

Specifies a location for publishing the package.

-RequiredVersion [<String>]

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.

-ScriptPublishLocation [<String>]

Specifies a script publishing location for the package.

-ScriptSourceLocation [<String>]

Specifies a script source location.

-Source [<String[]>]

Specifies one or more package sources. You can get a list of available package sources by using the Get-PackageSource cmdlet.

-Tag [<String[]>]

Specifies one or more strings to search for in the package metadata.

-Type [<String>]

Specifies whether to search for packages with a module, a script, or either.

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable.

Inputs

You cannot pipe input to this cmdlet

Outputs

SoftwareIdentify[]

This cmdlet does not produce any output.

Examples
  1. Find all available packages from a package provider:
    PS C:> Find-Package -Provider "PSModule"
    

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

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

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

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

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

  6. Find packages within a range of versions:
    PS C:> Find-Package -Name "DSCAccelerator" -MinimumVersion "1.5.0" -MaximumVersion "2.1" -AllVersions
    

    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.

Related Links

Get-Package
Install-Package
Save-Package
Uninstall-Package