• Skip to primary navigation
  • Skip to main content
  • Skip to footer

Stephanos Constantinou Blog

PowerShell Scripting

  • Home
  • Blogs
    • PowerShell Tutorials
    • PowerShell Scripts
    • PowerShell Modules
      • Modules Cmdlets
    • Software Reviews
  • About
  • Contact
You are here: Home / PowerShell Tutorials / PowerShell Providers

PowerShell Providers

11/07/2018 by Stephanos 1 Comment

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
  • Certificate
    • Drive: Cert:
    • Data Store: x509 Certificates for Digital Signatures
  • Environment
    • Drive: Env:
    • Data Store: Windows Environment Variables
  • FileSystem
    • Drive: (*)
    • Data Store: File System Drives, Directories and Files
  • Function
    • Drive: Function:
    • Data Store: PowerShell Functions
  • Registry
    • Drive: HKLM: and HKCU:
    • Data Store: Windows Registry
  • Variable
    • Drive: Variable:
    • Data Store: PowerShell Variables
  • WSMan
    • Drive: WSMan:
    • Data Store: WS-Management Configuration Information

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:

PowerShell Providers - Get-PSProvider

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:

PowerShell Providers - Get-PSProvider - ActiveDirectory

[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:

PowerShell Providers - Remove Provider Module

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:

PowerShell Providers - Remove Provider Drive

[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:

PowerShell Providers - Provider Home

 

PowerShell Providers - Change Home Value

PowerShell Providers - Change Home Value - Registry

[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”]

Summary
PowerShell Providers
Article Name
PowerShell Providers
Description
PowerShell Providers. In this tutorial you will find information about PowerShell Providers and thier use. Stephanos Constantinou Blog
Author
Stephanos
Publisher Name
Stephanos Constantinou Blog
Publisher Logo
Stephanos Constantinou Blog

Filed Under: PowerShell Tutorials Tagged With: Add-Content, Clear-Content, Clear-Item, Clear-ItemProperty, Convert-Path, Copy-Item, Copy-ItemProperty, Get-ChildItem, Get-Content, Get-Item, Get-ItemProperty, Get-Location, Get-PSDrive, Get-PSProvider, Import-Module, Invoke-Item, Join-Path, Move-Item, Move-ItemProperty, New-Item, New-ItemProperty, New-PSDrive, Pop-Location, Push-Location, Remove-Item, Remove-ItemProperty, Remove-PSDrive, Rename-Item, Rename-ItemProperty, Resolve-Path, Set-Content, Set-Item, Set-ItemProperty, Set-Location, Split-Path, Test-Path

Reader Interactions

Comments

  1. Artem says

    06/04/2020 at 19:15

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

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Footer

Recent Posts

  • ICS Cube Product Review 26/04/2019
  • PowerShell Module SysInfo v1.2.0 15/03/2019
  • PowerShell Module SysInfo v1.1.2 13/11/2018
  • PowerShell Module SysInfo 24/10/2018
  • Get-VoltageProbe 24/10/2018
  • Get-VideoController 24/10/2018
  • Get-USBController 24/10/2018
  • Get-TrackPoint 24/10/2018
  • Get-TrackBall 24/10/2018
  • Get-TouchScreen 24/10/2018
Planet PowerShell

Categories

  • Modules Cmdlets (57)
  • PowerShell Modules (5)
  • PowerShell Scripts (38)
  • PowerShell Tutorials (35)
  • Software Reviews (2)

Archives

  • April 2019 (1)
  • March 2019 (1)
  • November 2018 (1)
  • October 2018 (56)
  • September 2018 (13)
  • August 2018 (9)
  • July 2018 (6)
  • June 2018 (8)
  • May 2018 (7)
  • April 2018 (9)
  • March 2018 (4)
  • February 2018 (6)
  • January 2018 (12)
  • December 2017 (4)
Top 10 PowerShell 2018

Blogroll

  • Planet PowerShell
  • Reddit – PowerShell
  • PowerShell Magazine
  • PowerShell.org
  • PowerShell Team Blog
  • Hey, Scripting Guy! Blog
  • Mike F Robbins
  • PowerShell Explained with Kevin Marquette
  • Mike Kanakos – Network Admin
  • The Lonely Administrator
  • AskME4Tech
PowerShell Blogs Sysadmin Blogs Banners for Top 20 Programming Blogs

© 2023 · Stephanos Constantinou Blog

  • Home
  • Blogs
  • About
  • Contact