Providers Basics
PowerShell · Reference cheat sheet
Providers Basics
PowerShell · Reference cheat sheet
📋 Overview
Providers expose hierarchical data stores as if they were drives: the filesystem, registry, environment variables, certificates, and more. You navigate them with familiar cmdlets like Set-Location and Get-ChildItem.
🔧 Core concepts
| Provider / Drive | What it surfaces |
|---|---|
FileSystem | Disks (C:, /) |
Env: | Environment variables |
HKLM: / HKCU: | Registry (Windows) |
Variable: | PowerShell variables |
Alias: | Command aliases |
Function: | Functions |
Cert: | Certificates (Windows) |
Get-PSProvider and Get-PSDrive list what is available.
💡 Examples
List providers and drives:
Get-PSProvider
Get-PSDriveEnvironment drive:
Set-Location Env:
Get-ChildItem | Select-Object -First 10
Get-Content PATH
Set-Location $HOMEFilesystem navigation (same cmdlets):
Set-Location $HOME
Get-ChildItem
New-Item -ItemType Directory -Path .\ps-practice -ForceAliases drive:
Get-ChildItem Alias: | Where-Object Name -EQ "ls"⚠️ Pitfalls
- Registry edits can break Windows — practice read-only first (
Get-ChildItem HKCU:\...). - Not every provider supports every cmdlet the same way.
- Paths like
Env:\PATHdiffer from Bash$PATHsyntax. - Leaving yourself in
Env:orHKCU:confuses later relative paths —cd $HOMEwhen done.