On this page

PowerShell providers and the drive model

Published on September 6, 2026

Enrico Hochkoeppler Profile

By Enrico Hochkoeppler

Web Developer & TutoriaLibre Founder

PowerShell providers and PSDrives let different kinds of data—files, registry keys, certificates, environment variables, and more—look and behave like folders and drives. Once this model is clear, the same small set of commands can be used to explore almost any data store in PowerShell.


Overview of providers and PSDrives​

PowerShell does not limit navigation to the file system. Instead, it uses providers to expose many data stores through a common, hierarchical structure. Each provider exposes one or more PSDrives, which appear as drive letters or names followed by a colon (for example C:, HKLM:, Env:).

The key idea is simple: learn a few navigation commands once, then reuse them everywhere—on files, registry keys, certificates, environment variables, and other provider data.


What a PowerShell provider is​

A provider is a PowerShell component that exposes a data store as a tree of items and containers, similar to files and folders. Each provider defines how to:

Common built‑in providers include:

Each provider can expose one or more PSDrives that act as entry points into that data.


What a PSDrive is​

A PSDrive is a logical drive that connects a provider to a specific root location. It looks like a drive name followed by a colon, but it does not have to be a physical disk.

Examples:

Important points:

This is why PowerShell can show “fake” drive labels such as HKLM: or Env:—they are PSDrives backed by providers, not necessarily by physical disks.


Listing available providers​

Get-PSProvider shows all providers available in the current session.


Get-PSProvider

Explanation:
This command lists each provider with its name, capabilities, and associated drives. It is the primary way to discover which data stores PowerShell can expose on the current system. For example, it reveals whether the Certificate or WSMan providers are available.

To focus on specific providers:


Get-PSProvider -Name FileSystem, Registry

Explanation:
This filters the output to only the FileSystem and Registry providers, which is useful when concentrating on storage and configuration data.


Listing available drives​

Get-PSDrive lists all PSDrives currently defined in the session.


Get-PSDrive

Explanation:
This command shows each drive’s name, provider, root, and (for file system drives) size, used space, and free space. It includes local volumes, mapped network drives, registry hives, environment variables, and other provider drives.

To list only file system drives:


Get-PSDrive -PSProvider FileSystem

Explanation:
This filters the output to drives backed by the FileSystem provider, such as C:, D:, and any mapped network drives. It is a quick way to see which file system drives are available.


Navigating providers with familiar commands​

All providers expose their data as a hierarchy, so the same navigation commands work across them:

Navigating the file system​


Set-Location C:\

Get-ChildItem

Get-Location

Explanation:
The location is changed to the root of the C: drive, the contents of that directory are listed, and the current path is displayed.

Navigating the registry​


Set-Location HKLM:\Software

Get-ChildItem

Explanation:
The location is changed to the HKEY_LOCAL_MACHINE\Software registry key, and all subkeys and values under that key are listed. The same commands used for folders now work on registry keys.

Navigating the certificate store​


Set-Location Cert:\LocalMachine\My

Get-ChildItem

Explanation:
The location is changed to the local machine’s personal certificate store, and all certificates in that store are listed.

Navigating environment variables​


Set-Location Env:

Get-ChildItem

Explanation:
The location is changed to the environment provider, and all environment variables are listed as items with names and values.


Creating custom PSDrives​

Custom PSDrives are useful when a path is long or when a specific location is used frequently.

Creating a temporary file system drive​


New-PSDrive -Name Data -PSProvider FileSystem -Root 'D:\Projects'

Set-Location Data:

Get-ChildItem

Explanation:
A new PSDrive named Data: is created, pointing to D:\Projects. The location is changed to Data:, and the contents of that folder are listed. This drive exists only in the current PowerShell session.

Creating a temporary registry drive​


New-PSDrive -Name HKApps -PSProvider Registry -Root 'HKEY_LOCAL_MACHINE\Software'

Set-Location HKApps:

Get-ChildItem

Explanation:
A new PSDrive named HKApps: is created, pointing to the HKEY_LOCAL_MACHINE\Software registry key. This makes it easier to work with that part of the registry without typing the full path each time.

Removing a PSDrive​


Remove-PSDrive -Name Data

Explanation:
The Data: drive is removed from the current session. Any open locations under that drive are no longer valid.


Persistent mapped network drives​

For the FileSystem provider, New-PSDrive can create persistent mapped network drives that appear in both PowerShell and File Explorer.


New-PSDrive -Name X -PSProvider FileSystem -Root '\\fileserver\share' -Persist

Explanation:
A new drive X: is created and mapped to the network share \\fileserver\share. The -Persist parameter makes the mapping visible to Windows and keeps it across sessions, similar to mapping a network drive in File Explorer. Only the FileSystem provider supports -Persist.


Provider capabilities and dynamic parameters​

Providers advertise capabilities that affect how generic cmdlets behave. Common capabilities include:

When a cmdlet such as Get-ChildItem is used against a provider, it can expose dynamic parameters that only exist for that provider. For example:

This design allows a small set of cmdlets (Get‑Item, Get‑ChildItem, Set‑Item, Remove‑Item, etc.) to work across many providers while still exposing provider‑specific options when needed.


Understanding drive types and disk information​

PSDrives show logical drives, but sometimes it is necessary to know whether a drive is local, network, removable, or backed by a specific physical disk.

Listing logical drives and types​


Get-CimInstance -ClassName Win32_LogicalDisk |

    Select-Object DeviceID, DriveType, ProviderName, Size, FreeSpace

Explanation:
This command queries Windows for all logical disks and shows their drive letters (DeviceID), drive type (local, network, removable, etc.), network provider name (for mapped drives), and size and free space. It complements Get-PSDrive by providing drive type information.

Inspecting physical disks​


Get-PhysicalDisk |

    Select-Object FriendlyName, MediaType, BusType, Size, SerialNumber

Explanation:
This command lists physical disks, showing their friendly names, media types (HDD or SSD), bus types (SATA, NVMe, USB, etc.), sizes, and serial numbers. It is useful when correlating logical drives with underlying hardware.

An alternative using CIM:


Get-CimInstance -ClassName Win32_DiskDrive |

    Select-Object Model, InterfaceType, SerialNumber, Size

Explanation:
This retrieves disk drive information from WMI/CIM, including the disk model, interface type (for example SATA or USB), serial number, and size. It is often used when identifying external versus internal drives or when gathering inventory data.


Practical command reference​

Found this helpful? Share the knowledge...

... or support this project to keep it alive!

Buy Me a Coffee

Previous

Working with Objects

Next

Scripting Fundamentals