A PSDrive is a PowerShell drive abstraction that exposes a filesystem or another provider-backed data store through a drive-like path. A provider adapts the data store, while the PSDrive makes it accessible to PowerShell commands. section 5.0 section 5.1
Use these commands to inspect drives and work with their contents:
- Run Get-PSDrive to list available drives, including filesystem, environment, alias, function, and variable drives. section 5.1
- Use generic item cmdlets such as Get-Item, Get-ChildItem, New-Item, Copy-Item, Move-Item, and Remove-Item. section 5.1 section 5.2
- Change the current location with Set-Location or its cd alias, using paths appropriate to the operating system. section 5.3
Use a non-filesystem drive
The Environment provider is available across systems. List environment variables with Get-ChildItem env:*; create variable A with Set-Item -Path Env:/A -Value 1; then verify it with Get-ChildItem Env:/A*. section 5.5
PS C:\Scripts> Get-PSDrive Name Used (GB) Free (GB) Provider Root ---- --------- --------- -------- ---- / 159.55 306.11 FileSystem / Alias Alias Env Environment Function Function Variable Variable
The drive listing shows that PSDrives can expose different providers, not only filesystem roots. section 5.1
