Each of the providers shares a common set of commands, such as Set-Location
, Get-Item
, and New-Item
.
Set-Location
, which has the alias cd
, is used to navigate around a provider's hierarchy; for example:
Set-Location \ # The root of the current drive
Set-Location Windows # A child container named Windows
Set-Location .. # Navigate up one level
Set-Location ..\.. # Navigate up two levels
Set-Location Cert: # Change to a different drive
Set-Location HKLM:\Software # Change to a specific child container under a drive
Set-Location
may only be used to switch to a container object.
The print working directory (pwd
) variable shows the current location across all providers:
PS> $pwd Path ---- HKLM:\Software\Microsoft\Windows\CurrentVersion