다음을 통해 공유


Get-PSProvider

Gets information about the specified PowerShell provider.

구문

Default (기본값)

Get-PSProvider
    [[-PSProvider] <String[]>]
    [<CommonParameters>]

Description

The Get-PSProvider cmdlet gets the PowerShell providers in the current session. You can get a particular drive or all drives in the session.

PowerShell providers let you access a variety of data stores as though they were file system drives. For information about PowerShell providers, see about_Providers.

예제

Example 1: Display a list of all available providers

Get-PSProvider

This command displays a list of all available PowerShell providers.

Example 2: Display a list of all PowerShell providers that begin with specified letters

Get-PSProvider F*, R* | Format-List

This command displays a list of all PowerShell providers with names that begin with the letter F or R.

Example 3: Find snap-ins or module that added providers to your session

Get-PSProvider | Format-Table Name, Module, PSSnapIn -AutoSize
Name        Module                        PSSnapIn
----        ------                        --------
Registry                                  Microsoft.PowerShell.Core
Alias                                     Microsoft.PowerShell.Core
Environment                               Microsoft.PowerShell.Core
FileSystem                                Microsoft.PowerShell.Core
Function                                  Microsoft.PowerShell.Core
Variable                                  Microsoft.PowerShell.Core
Certificate Microsoft.PowerShell.Security
WSMan       Microsoft.WSMan.Management
Get-PSProvider | where {$_.ModuleName -eq "Microsoft.PowerShell.Security"}
Name            Capabilities      Drives
----            ------------      ------
Certificate     ShouldProcess     {cert}

These commands find the PowerShell snap-ins or modules that added providers to your session. All PowerShell elements, including providers, originate in a snap-in or in a module.

These commands use the PSSnapin and Module properties of the ProviderInfo object that Get-PSProvider returns. The values of these properties contain the name of the snap-in or module that adds the provider.

The first command gets all of the providers in the session and formats them in a table with the values of their Name, Module, and PSSnapin properties.

The second command uses the Where-Object cmdlet to get the providers that come from the Microsoft.PowerShell.Security snap-in.

Example 4: Resolve the path of the Home property of the FileSystem provider

C:\> Resolve-Path ~
Path
----
C:\Users\User01
PS C:\> (Get-PSProvider FileSystem).Home
C:\Users\User01

This example shows that the tilde symbol (~) represents the value of the Home property of the FileSystem provider. The Home property value is optional, but for the FileSystem provider, it is defined as $Env:HOMEDRIVE\$Env:HOMEPATH or $HOME.

매개 변수

-PSProvider

Specifies the name or names of the PowerShell providers about which this cmdlet gets information.

매개 변수 속성

형식:

String[]

Default value:None
와일드카드 지원:False
DontShow:False

매개 변수 집합

(All)
Position:0
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:True
나머지 인수의 값: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.

입력

String

You can pipe one or more provider name strings to this cmdlet.

출력

ProviderInfo

This cmdlet returns objects that represent the PowerShell providers in the session.