次の方法で共有


Find-Package

Finds software packages in available package sources.

構文

NuGet

Find-Package
    [[-Name] <String[]>]
    [-IncludeDependencies]
    [-AllVersions]
    [-Source <String[]>]
    [-Credential <PSCredential>]
    [-Proxy <Uri>]
    [-ProxyCredential <PSCredential>]
    [-RequiredVersion <String>]
    [-MinimumVersion <String>]
    [-MaximumVersion <String>]
    [-Force]
    [-ForceBootstrap]
    [-ProviderName <String[]>]
    [-ConfigFile <String>]
    [-SkipValidate]
    [-Headers <String[]>]
    [-FilterOnTag <String[]>]
    [-Contains <String>]
    [-AllowPrereleaseVersions]
    [<CommonParameters>]

PowerShellGet

Find-Package
    [[-Name] <String[]>]
    [-IncludeDependencies]
    [-AllVersions]
    [-Source <String[]>]
    [-Credential <PSCredential>]
    [-Proxy <Uri>]
    [-ProxyCredential <PSCredential>]
    [-RequiredVersion <String>]
    [-MinimumVersion <String>]
    [-MaximumVersion <String>]
    [-Force]
    [-ForceBootstrap]
    [-ProviderName <String[]>]
    [-AllowPrereleaseVersions]
    [-PackageManagementProvider <String>]
    [-PublishLocation <String>]
    [-ScriptSourceLocation <String>]
    [-ScriptPublishLocation <String>]
    [-Type <String>]
    [-Filter <String>]
    [-Tag <String[]>]
    [-Includes <String[]>]
    [-DscResource <String[]>]
    [-RoleCapability <String[]>]
    [-Command <String[]>]
    [-AcceptLicense]
    [<CommonParameters>]

説明

Find-Package finds software packages that are available in package sources. Get-PackageProvider and Get-PackageSource display details about your providers.

Important

The commands contained in the PackageManagement module are different than the commands provided by the NuGet module in the Package Manager Console of Visual Studio. Each module has commands that are not available in the other. Commands with the same name differ in their specific arguments. For more information, see the PowerShell reference documentation for the Package Manager Console of Visual Studio.

Example 1: Find all available packages from a package provider

This command finds all available PowerShell module packages in a registered gallery. Use Get-PackageProvider to get the provider name.

Find-Package -ProviderName NuGet
Name               Version   Source     Summary
----               -------   ------     -------
NUnit              3.11.0    MyNuGet    NUnit is a unit-testing framework for all .NET langua...
Newtonsoft.Json    12.0.1    MyNuGet    Json.NET is a popular high-performance JSON framework...
EntityFramework    6.2.0     MyNuGet    Entity Framework is Microsoft's recommended data acce...
MySql.Data         8.0.15    MyNuGet    MySql.Data.MySqlClient .Net Core Class Library
bootstrap          4.3.1     MyNuGet    Bootstrap framework in CSS. Includes fonts and JavaSc...
NuGet.Core         2.14.0    MyNuGet    NuGet.Core is the core framework assembly for NuGet...

Find-Package uses the Provider parameter to specify the provider NuGet.

Example 2: Find a package from a package source

This command finds the newest version of a package from a specified package source. If a package source isn't provided, Find-Package searches each installed package provider and its package sources. Use Get-PackageSource to get the source name.

Find-Package -Name NuGet.Core -Source MyNuGet
Name         Version   Source    Summary
----         -------   ------    -------
NuGet.Core   2.14.0    MyNuGet   NuGet.Core is the core framework assembly for NuGet...

Find-Package uses the Name parameter to specify the package name NuGet.Core. The Source parameter specifies to search for the package in MyNuGet.

Example 3: Find all versions of a package

This command finds all available package versions from a specified provider.

Find-Package -Name NuGet.Core -Source MyNuGet -AllVersions
Name          Version          Source       Summary
----          -------          ------       -------
NuGet.Core    2.14.0           MyNuGet      NuGet.Core is the core framework assembly for NuGet...
NuGet.Core    2.14.0-rtm-832   MyNuGet      NuGet.Core is the core framework assembly for NuGet...
NuGet.Core    2.13.0           MyNuGet      NuGet.Core is the core framework assembly for NuGet...
...
NuGet.Core    1.1.229.159      MyNuGet      NuGet.Core is the core framework assembly for NuGet...
Nuget.Core    1.0.1120.104     MyNuGet      NuGet.Core is the core framework assembly for NuGet...

Find-Package uses the Name parameter to specify the package NuGet.Core. The ProviderName parameter specifies to search for the package in MyNuGet. AllVersions specifies that all available versions are returned.

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

This command finds a specific package version from a specified provider.

Find-Package -Name NuGet.Core -ProviderName NuGet -RequiredVersion 2.9.0
Name          Version          Source       Summary
----          -------          ------       -------
NuGet.Core    2.9.0            MyNuGet      NuGet.Core is the core framework assembly for NuGet...

Find-Package uses the Name parameter to specify the package name NuGet.Core. The ProviderName parameter specifies to search for the package in NuGet. RequiredVersion specifies that only version 2.9.0 is returned.

Example 5: Find packages within a range of versions

This command finds a range of versions for a specified package.

Find-Package -Name NuGet.Core -ProviderName NuGet -MinimumVersion 2.7.0 -MaximumVersion 2.9.0 -AllVersions
Name          Version          Source       Summary
----          -------          ------       -------
NuGet.Core    2.9.0            MyNuGet      NuGet.Core is the core framework assembly for NuGet...
NuGet.Core    2.8.6            MyNuGet      NuGet.Core is the core framework assembly for NuGet...
NuGet.Core    2.8.0            MyNuGet      NuGet.Core is the core framework assembly for NuGet...
NuGet.Core    2.7.0            MyNuGet      NuGet.Core is the core framework assembly for NuGet...

Find-Package uses the Name parameter to specify the package name NuGet.Core. The ProviderName parameter specifies to search for the package in NuGet. MinimumVersion specifies the lowest version 2.7.0. MaximumVersion specifies the highest version 2.9.0. AllVersions determines the range is returned as specified by the minimum and maximum.

Example 6: Find a package from a file system

This command finds packages with the file extension .nupkg that are stored on the local computer. The files are packages downloaded from a gallery such as the NuGet.

PS> Find-Package -Source C:\LocalPkg
Name                 Version    Source           Summary
----                 -------    ------           -------
Microsoft.Web.Xdt    3.0.0      C:\LocalPkg\     Microsoft Xml Document Transformation (XDT)...
NuGet.Core           2.14.0     C:\LocalPkg\     NuGet.Core is the core framework assembly...

パラメーター

-AcceptLicense

Automatically accepts a license agreement if the package requires it.

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

PowerShellGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-AllowPrereleaseVersions

Includes packages marked as a prerelease in the results.

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-AllVersions

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

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Command

Specifies an array of commands searched by Find-Package.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

PowerShellGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-ConfigFile

Specifies a configuration file.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

NuGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Contains

Find-Package gets objects if any item in the object's property values are an exact match for the specified value.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

NuGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Credential

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

パラメーターのプロパティ

型:PSCredential
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-DscResource

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

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

PowerShellGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Filter

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

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

PowerShellGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-FilterOnTag

Specifies the tag that filters the results. Results that don't contain the specified tag are excluded.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

NuGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Force

Forces the command to run without asking for user confirmation.

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-ForceBootstrap

Indicates that Find-Package forces PackageManagement to automatically install the package provider.

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Headers

Specifies the headers for the package.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

NuGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-IncludeDependencies

Indicates that this cmdlet includes package dependencies in the results.

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Includes

Specifies whether Find-Package should find all packages within a category.

The accepted values are as follows:

  • Cmdlet
  • DscResource
  • Function
  • RoleCapability
  • Workflow

パラメーターのプロパティ

型:

String[]

規定値:None
指定可能な値:Cmdlet, DscResource, Function, RoleCapability, Workflow
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

PowerShellGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-MaximumVersion

Specifies the maximum package version that you want to find.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-MinimumVersion

Specifies the minimum package version that you want to find. If a higher version is available, that version is returned.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Name

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

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:True
DontShow:False

パラメーター セット

(All)
配置:0
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-PackageManagementProvider

Specifies the name of a package management provider.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

PowerShellGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-ProviderName

Specifies one or more package provider names. Separate multiple package provider names with commas. Use Get-PackageProvider to get a list of available package providers.

パラメーターのプロパティ

型:

String[]

規定値:None
指定可能な値:Bootstrap, NuGet, PowerShellGet
ワイルドカードのサポート:False
DontShow:False
Aliases:Provider

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-Proxy

Specifies a proxy server for the request, rather than a direct connection to the internet resource.

パラメーターのプロパティ

型:Uri
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-ProxyCredential

Specifies a user account that has permission to use the proxy server that is specified by the Proxy parameter.

パラメーターのプロパティ

型:PSCredential
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-PublishLocation

Specifies a ___location for publishing the package.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

PowerShellGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-RequiredVersion

Specifies an exact package version that you want to find.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-RoleCapability

Specifies an array of role capabilities.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

PowerShellGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-ScriptPublishLocation

Specifies a script publishing ___location for the package.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

PowerShellGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-ScriptSourceLocation

Specifies a script source ___location.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

PowerShellGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-SkipValidate

Switch that skips package credential validation.

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

NuGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Source

Specifies one or more package sources. Use Get-PackageSource to get a list of available package sources. A file system directory can be used as a source for download packages.

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-Tag

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

パラメーターのプロパティ

型:

String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

PowerShellGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Type

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

パラメーターのプロパティ

型:String
規定値:None
指定可能な値:Module, Script, All
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

PowerShellGet
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

入力

None

You can't pipe objects to this cmdlet.

出力

SoftwareIdentify

This cmdlet returns a SoftwareIdentity object.

メモ

Important

As of April 2020, the PowerShell Gallery no longer supports Transport Layer Security (TLS) versions 1.0 and 1.1. If you are not using TLS 1.2 or higher, you will receive an error when trying to access the PowerShell Gallery. Use the following command to ensure you are using TLS 1.2:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

For more information, see the announcement in the PowerShell blog.