次の方法で共有


Install-PackageProvider

Installs one or more Package Management package providers.

構文

PackageBySearch (既定)

Install-PackageProvider
    [-Name] <String[]>
    [-RequiredVersion <String>]
    [-MinimumVersion <String>]
    [-MaximumVersion <String>]
    [-Credential <PSCredential>]
    [-Scope <String>]
    [-Source <String[]>]
    [-Proxy <Uri>]
    [-ProxyCredential <PSCredential>]
    [-AllVersions]
    [-Force]
    [-ForceBootstrap]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

PackageByInputObject

Install-PackageProvider
    [-InputObject] <SoftwareIdentity[]>
    [-Scope <String>]
    [-Proxy <Uri>]
    [-ProxyCredential <PSCredential>]
    [-AllVersions]
    [-Force]
    [-ForceBootstrap]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

説明

The Install-PackageProvider cmdlet installs matching Package Management providers that are available in package sources registered with PowerShellGet. By default, this includes modules available in the Windows PowerShell Gallery with the PackageManagement tag. The PowerShellGet Package Management provider is used for finding providers in these repositories.

This cmdlet also installs matching Package Management providers that are available using the Package Management bootstrapping application.

Example 1: Install a package provider from the PowerShell Gallery

This command installs the GistProvider package provider from the PowerShell Gallery.

Install-PackageProvider -Name "GistProvider" -Verbose

Example 2: Install a specified version of a package provider

This example installs a specified version of the NuGet package provider.

The first command finds all versions of the package provider named NuGet. The second command installs a specified version of the NuGet package provider.

Find-PackageProvider -Name "NuGet" -AllVersions
Install-PackageProvider -Name "NuGet" -RequiredVersion "2.8.5.216" -Force

You only need to install the NuGet package provider if you are running PackageManagement v1.1.0.0 in Windows PowerShell. Newer versions of PowerShellGet and PackageManagement include the NuGet package provider by default.

Example 3: Find a provider and install it

This example uses Find-PackageProvider and the pipeline to search for the Gist provider and install it.

Find-PackageProvider -Name "GistProvider" | Install-PackageProvider -Verbose

Example 4: Install a provider to the current user's module folder

This command installs a package provider to $env:LOCALAPPDATA\PackageManagement\ProviderAssemblies so that only the current user can use it.

Install-PackageProvider -Name GistProvider -Verbose -Scope CurrentUser

パラメーター

-AllVersions

Indicates that this cmdlet installs all available versions of the package provider. By default, Install-PackageProvider only returns the highest available version.

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

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

パラメーター セット

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

-Confirm

Prompts you for confirmation before running the cmdlet.

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

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

パラメーター セット

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

-Credential

Specifies a user account that has permission to install package providers.

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

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

パラメーター セット

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

-Force

Indicates that this cmdlet forces all actions with this cmdlet that can be forced. Currently, this means the Force parameter acts the same as the ForceBootstrap parameter.

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

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

パラメーター セット

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

-ForceBootstrap

Indicates that this cmdlet automatically installs the package provider.

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

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

パラメーター セット

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

-InputObject

Specifies a SoftwareIdentity object. Use the Find-PackageProvider cmdlet to obtain a SoftwareIdentity object to pipe into Install-PackageProvider.

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

型:

Microsoft.PackageManagement.Packaging.SoftwareIdentity[]

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

パラメーター セット

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

-MaximumVersion

Specifies the maximum allowed version of the package provider that you want to install. If you do not add this parameter, Install-PackageProvider installs the highest available version of the provider.

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

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

パラメーター セット

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

-MinimumVersion

Specifies the minimum allowed version of the package provider that you want to install. If you do not add this parameter, Install-PackageProvider installs the highest available version of the package that also satisfies any requirement specified by the MaximumVersion parameter.

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

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

パラメーター セット

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

-Name

Specifies one or more package provider module names. Separate multiple package names with commas. Wildcard characters aren't supported.

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

型:

String[]

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

パラメーター セット

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

-Proxy

Specifies a proxy server for the request, rather than connecting directly 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's specified by the Proxy parameter.

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

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

パラメーター セット

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

-RequiredVersion

Specifies the exact allowed version of the package provider that you want to install. If you don't add this parameter, Install-PackageProvider installs the highest available version of the provider that also satisfies any maximum version specified by the MaximumVersion parameter.

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

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

パラメーター セット

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

-Scope

Specifies the installation scope of the provider. The acceptable values for this parameter are:

  • AllUsers - installs providers in a location that's accessible to all users of the computer. By default, this is $env:ProgramFiles\PackageManagement\ProviderAssemblies.

  • CurrentUser - installs providers in a location where they're only accessible to the current user. By default, this is $env:LOCALAPPDATA\PackageManagement\ProviderAssemblies.

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

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

パラメーター セット

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

-Source

Specifies one or more package sources. Use the Get-PackageSource cmdlet to get a list of available package sources.

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

型:

String[]

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

パラメーター セット

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet isn't run.

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

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

パラメーター セット

(All)
配置: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.

入力

Microsoft.PackageManagement.Packaging.SoftwareIdentity

You can pipe a SoftwareIdentity object to this cmdlet. Use Find-PackageProvider to get a SoftwareIdentity object that can be piped into Install-PackageProvider.

メモ

Important

As of April 2020, the PowerShell Gallery no longer supports Transport Layer Security (TLS) versions 1.0 and 1.1. If you aren't 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.