Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Find-Package

Find-Package

microsoft.powershell.oneget.dll, microsoft.powershell.packagemanagement.dll

Synopsis

Finds software packages in available package sources.

Syntax

Find-Package [-Name] [-AllVersions] [-Credential] [-Force] [-ForceBootstrap] [-IncludeDependencies] [-MaximumVersion] [-MinimumVersion] [-ProviderName] [-RequiredVersion] [-Source] [<CommonParameters>]

Detailed Description

Finds matching software packages that are available in package sources.

Parameters

-AllVersions <SwitchParameter>

If you add this parameter, Find-Package returns all available versions of the package, or all versions of the package that are in the range specified by the MinimumVersion and MaximumVersion parameters. By default, Find-Package returns the newest available version.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Credential <PSCredential>

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

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Force <SwitchParameter>

Forces a search for specified packages.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-ForceBootstrap <SwitchParameter>

Forces OneGet to bootstrap—or automatically install—the package provider for the specified package.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-IncludeDependencies <SwitchParameter>

If you add this parameter, the search scope is expanded to include packages on which the specified package depends.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-MaximumVersion <String>

Specifies the highest-numbered version of a specified package that you want returned in your command results. By default, without this or the MinimumVersion parameters, Find-Package returns the newest available version.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-MinimumVersion <String>

Specifies the lowest-numbered version of a specified package that you want returned in your command results. By default, without this or the MaximumVersion parameters, Find-Package returns the newest available version.

Aliases

Version

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Name <String[]>

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

Aliases

None

Required?

false

Position

1

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-ProviderName <String[]>

Specifies one or more package providers. Separate multiple provider names with commas. You can get a list of package providers that are connected to OneGet by running the Get-PackageProvider cmdlet.

Aliases

Provider

Required?

false

Position

named

Default value

None

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

-RequiredVersion <String>

Specifies the exact version of the package that you want to find. By default, without this parameter, Find-Package returns the newest available version. You cannot add this parameter to a command that includes either or both of the MinimumVersion or MaximumVersion parameters.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Source <String[]>

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

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

Input Type


Return Type

SoftwareIdentify[]

Notes

None

Examples

Example 1: Find all available packages from a package provider

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

PS C:\>Find-Package –Provider PSModule

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

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

PS C:\>Find-Package Git –Provider Chocolatey

Example 3: Find a package from a package source

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.

PS C:\>Find-Package Git –Source ChocolateyRepository

Example 4: Find a package from a file system

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

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

Example 5: Find a package with a specific name and version

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.

PS C:\>Find-Package –Name DSCAccel –RequiredVersion 2.1.2

Example 6: Find packages within a range of versions

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.

PS C:\>Find-Package –Name DSCAccelerator –MinimumVersion 1.5.0 –MaximumVersion 2.1 –AllVersions


Online Version
Get-Package
Install-Package
Save-Package
Uninstall-Package