Browsing anywhere in registry with PowerShell


I think you all know that, but PowerShell gives us a nice way to explore registry :


If you have a look at Get-PSDrive :


You’ll see that you have two drive dedicated to registry : HKCU and HKLM, for “Current User” and “Local Machine” respectively.

Now, let’s have a look at “RegEdit.exe” :


There are a lot more hives than just the two available in the PSDrive. You can mount a new PSDrive pointing to another hive :

New-PSDrive -Name HKUsers -PSProvider Registry -Root HKEY_USERS


Sure you can add it to your profile to create the PSDrive at each PowerShell.exe start, but, you have an alternative :


You can force the use of the registry provider to browse anywhere in the registry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.