PowerShell Providers
In this tutorial we will go though PowerShell Providers. We will see which are the default providers in Windows PowerShell and how we are able to import and remove providers from a session. Microsoft describes PowerShell Providers as below:
PowerShell providers are Microsoft .NET Framework-based programs that make the data in a specialized data store available in PowerShell so that you can view and manage it.
You can access the data in a provider the same way like accessing files in your data drive. Each provider supports all Windows PowerShell core set of commands that are included by default. Those commands are provided in “PowerShell Core Commands” tutorial. A provider may have also custom commands only for the specific provider that you can use with it. Also some parameters may be available on existing commands that you are allowed to use them with the specific provider only.
Below is a list of the built-in providers in Windows PowerShell.
Built-in Providers
- Alias
- Drive:
Alias:
- Data Store: PowerShell Aliases
- Drive:
- Certificate
- Drive:
Cert:
- Data Store: x509 Certificates for Digital Signatures
- Drive:
- Environment
- Drive:
Env:
- Data Store: Windows Environment Variables
- Drive:
- FileSystem
- Drive: (*)
- Data Store: File System Drives, Directories and Files
- Function
- Drive:
Function:
- Data Store: PowerShell Functions
- Drive:
- Registry
- Drive:
HKLM:
andHKCU:
- Data Store: Windows Registry
- Drive:
- Variable
- Drive:
Variable:
- Data Store: PowerShell Variables
- Drive:
- WSMan
- Drive:
WSMan:
- Data Store: WS-Management Configuration Information
- Drive:
During a session you are able to create your own provider. To create a provider you need to
[adinserter name=”In Article”]
Find the loaded PowerShell Providers
In order to see the current providers that are loaded in your current session you need to used the following command:
Code:
Get-PSProvider
Output:
Adding and Removing Providers
Adding a Provider
The providers, except of the built-in ones which are loaded by default, are added / installed in Windows PowerShell when you import a module in the current session. In the example below you can see that I import ActiveDirectory module into my session and when I check the loaded providers, I can see the provider for Active Directory.
Code:
Get-PSProvider Import-Module ActiveDirectory Get-PSProvider
Output:
[adinserter name=”In Article”]
Removing a Provider
If we want to remove a provider from our current session, there are two ways to do it. The first one is to remove the module from the current session. If you remove the module then the provider will be removed also. You can remove the module by using the below command.
Code:
Get-PSProvider Remove-Module ActiveDirectory Get-PSProvider
Output:
The other way to remove a provider is to remove the drive associated with. Basically, this method will remove the drive but will not affect the data within the drive. It will make the drive unavailable. You can do so by using the following command.
Code:
Get-PSPsrovider Remove-PSDrive -Name "AD" Get-PSProvider
Output:
[adinserter name=”In Article”]
Provider Home
You are able to set Home for the providers. The only provider that has a default value for Home is FileSystem. All other providers have nothing as a default value but you can set it yourself. To provide a home directory for a provider you need to use the Home property of the provide. The below examples are showing the change of Home for FileSystem and Registry providers.
Code:
Get-PSProvider | Format-Table Name, Home (Get-PSProvider FileSystem).Home = 'C:\' Get-PSProvider | Format-Table Name, Home (Get-PSProvider Registry).Home = 'HKLM:\' Get-PSProvider | Format-Table Name, Home
Output:
[adinserter name=”In Article”]
Provider related cmdlets
Below I am providing you once again the related cmdlets for PowerShell Providers. More information about those commands you can find in the section below with related links.
- ChildItems cmdlets
Get-ChildItem
- Content cmdlets
Add-Content
Clear-Content
Get-Content
Set-Content
- Item cmdlets
Clear-Item
Copy-Item
Get-Item
Invoke-Item
Move-Item
New-Item
Remove-Item
Rename-Item
Set-Item
- ItemProperty cmdlets
Clear-ItemProperty
Copy-ItemProperty
Get-ItemProperty
Move-ItemProperty
New-ItemProperty
Remove-ItemProperty
Rename-ItemProperty
Set-ItemProperty
- Location cmdlets
Get-Location
Pop-Location
Push-Location
Set-Location
- Path cmdlets
Join-Path
Convert-Path
Split-Path
Resolve-Path
Test-Path
- PSDrive cmdlets
Get-PSDrive
New-PSDrive
Remove-PSDrive
- PSProvider cmdlets
Get-PSProvider
I hope the tutorial about PowerShell Providers is helpful.
Please let me know your comments and thoughts.
You feedback is appreciated.
[adinserter name=”In Article”]
Related Links:
- PowerShell Scripts
- PowerShell Tutorials
- PowerShell Core Commands
- about_Core_Commands | Microsoft Docs
- about_Providers | Microsoft Docs
- Import-Module – Microsoft Docs
- Get-ChildItem – Microsoft Docs
- Add-Content – Microsoft Docs
- Clear-Content – Microsoft Docs
- Get-Content – Microsoft Docs
- Set-Content – Microsoft Docs
- Clear-Item – Microsoft Docs
- Copy-Item – Microsoft Docs
- Get-Item – Microsoft Docs
- Invoke-Item – Microsoft Docs
- Move-Item – Microsoft Docs
- New-Item – Microsoft Docs
- Remove-Item – Microsoft Docs
- Rename-Item – Microsoft Docs
- Set-Item – Microsoft Docs
- Clear-ItemProperty – Microsoft Docs
- Copy-ItemProperty – Microsoft Docs
- Get-ItemProperty – Microsoft Docs
- Move-ItemProperty – Microsoft Docs
- New-ItemProperty – Microsoft Docs
- Remove-ItemProperty – Microsoft Docs
- Rename-ItemProperty – Microsoft Docs
- Set-ItemProperty – Microsoft Docs
- Get-Location – Microsoft Docs
- Pop-Location – Microsoft Docs
- Push-Location – Microsoft Docs
- Set-Location – Microsoft Docs
- Join-Path – Microsoft Docs
- Convert-Path – Microsoft Docs
- Split-Path – Microsoft Docs
- Resolve-Path – Microsoft Docs
- Test-Path – Microsoft Docs
- Get-PSDrive – Microsoft Docs
- New-PSDrive – Microsoft Docs
- Remove-PSDrive – Microsoft Docs
- Get-PSProvider – Microsoft Docs
[adinserter name=”Matched-Content”]


Could I see Active Directory items as folders and files in Windows Explorer if I mount PSDrive with -Persist option?