Stupid PowerShell Trick #2:
If you need to access your environment variables and your registry, use set-location! Both can be accessed just like a drive.
To access the environment variables:
PS C:> set-location Env:
To access the local machine’s registry:
PS C:> set-location HKLM:
To access the current user’s registry:
PS C:> set-location HKCU:
To access your original C: drive use:
PS C:> set-location C:
What’s cool about this trick is that the registry and Environment variables are treated like drives.
PS: Thanks to Rick for pointing out that I didn’t tell the user how to get *back* to the original drive.