PowerShell: What is Provider/Datastore

By Xah Lee. Date: . Last updated: .

What is Datastore

A datastore is Microsoft's name for “collections of data”. There are different type of datastores. For example:

What is Provider

A provider is a directory-like interface to a datastore.

For example, when you type dir (alias of Get-ChildItem) to list directory content, it is done via a provider.

Examples of using different providers:

dir env:
List Environment Variables.
dir function:
List Functions.
dir variable:
List variables.
dir alias:
List Aliases.

List providers

Get-PSProvider
List providers.
PowerShell list providers 2022-04-24
list providers

Show Drive Name of a Provider

Because provider is a directory-like interface, therefore it has driver names. You can cd name to start to work with that datastore.

Get-PSDrive
Show the “drive” name of provider.
PowerShell Get-PSDrive 2022-04-24
Get-PSDrive

For example of using a provider other than file system, see PowerShell: Windows Registry

List Functions

dir function:
List all functions.

Show Function Code

For example, mkdir is a function. To show the code, type (gcm mkdir).ScriptBlock