7.2. Drives

Providers would be useless if there were no way to get items from them. The standard mechanism to provide items is through a drive. Similar to Windows drives, PowerShell drives use an identifier followed by a colon like C: or D:. Unlike Windows drives, PowerShell drives can have longer identifiers like Env:, cert:, and HKCU:. We can get information about the drives currently registered on the system with the Get-PSDrive cmdlet:

PS> Get-PSDrive Name Provider Root CurrentLo cation ---- -------- ---- --------- Alias Alias C FileSystem C:\ cert Certificate \ D FileSystem D:\ E FileSystem E:\ Env Environment F FileSystem F:\ Function Function HKCU Registry HKEY_CURRENT_USER Software HKLM Registry HKEY_LOCAL_MACHINE ...indows Variable ...

Get Pro Windows PowerShell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.