Get-PSProvider
Published: February 29, 2012
Updated: August 15, 2012
Applies To: Windows PowerShell 2.0, Windows PowerShell 3.0
Get-PSProvider
Syntax
Detailed Description
The Get-PSProvider cmdlet gets the Windows PowerShell providers in the current session. You can get a particular drive or all drives in the session.
Windows PowerShell providers let you access a variety of data stores as though they were file system drives. For information about Windows PowerShell providers, see about_Providers.
Parameters
-PSProvider<String[]>
Specifies the name or names of the Windows PowerShell providers about which to retrieve information.
|
Aliases |
none |
|
Required? |
false |
|
Position? |
1 |
|
Default Value |
none |
|
Accept Pipeline Input? |
true (ByPropertyName) |
|
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
-
None
You cannot pipe objects to this cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
-
System.Management.Automation.ProviderInfo
Get-PSProvider returns objects that represent the Windows PowerShell providers in the session.
Examples
-------------------------- EXAMPLE 1 --------------------------
This command displays a list of all available Windows PowerShell providers.
PS C:\> get-psprovider
-------------------------- EXAMPLE 2 --------------------------
This command displays a list of all Windows PowerShell providers with names that begin with the letter "f" or "r".
PS C:\> get-psprovider f*, r* | format-list
-------------------------- EXAMPLE 3 --------------------------
These commands find the Windows PowerShell snap-ins or modules that added providers to your session. All Windows 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.
PS C:\> get-psprovider | format-table name, module, pssnapin -autoName Module PSSnapIn---- ------ --------Test TestModuleWSMan Microsoft.WSMan.ManagementAlias Microsoft.PowerShell.CoreEnvironment Microsoft.PowerShell.CoreFileSystem Microsoft.PowerShell.CoreFunction Microsoft.PowerShell.CoreRegistry Microsoft.PowerShell.CoreVariable Microsoft.PowerShell.CoreCertificate Microsoft.PowerShell.SecurityPS C:\>get-psprovider | where {$_.pssnapin -eq "Microsoft.PowerShell.Security"}Name Capabilities Drives---- ------------ ------Certificate ShouldProcess {cert}
-------------------------- EXAMPLE 4 --------------------------
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.
PS C:\> resolve-path ~Path----C:\Users\User01PS C:\>(get-psprovider FileSystem).homeC:\Users\User01
Related topics