PowerShell Providers

PowerShell exposes a number of “providers” as “drives”, which allows us to view certain data in a manner that resembles a file system drive, i.e. we can use operations like ls and cat on them (ish).

To list the available providers:

> Get-PSProvider

Name           Capabilities                          Drives
----           ------------                          ------
Alias          ShouldProcess                         {Alias}
Environment    ShouldProcess                         {Env}
FileSystem     Filter, ShouldProcess, Credentials    {Temp, /}
Function       ShouldProcess                         {Function}
Variable       ShouldProcess                         {Variable}

Windows only:

They can be accessed like filesystem objects in PowerShell, e.g. gci alias, get-item alias:gci, get-content alias:gci.

Examples

> gci alias:

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Alias           ? -> Where-Object                                             
Alias           % -> ForEach-Object                                           
Alias           cd -> Set-Location                                            
Alias           chdir -> Set-Location                                         
Alias           clc -> Clear-Content                                          
Alias           clhy -> Clear-History                                         
Alias           cli -> Clear-Item                                             
Alias           clp -> Clear-ItemProperty                                     
Alias           cls -> Clear-Host                                             

# equivalent to Get-Alias gci
> Get-Item alias:gci

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Alias           gci -> Get-ChildItem                                          

msdocs

the alias provider the function provider