PoshTip #15 – Accessing Windows Registry

PoshTip #15 – Accessing Windows Registry

Accessing the registry is as easy as accessing the file system.

Type the following command :

PS> Set-Location HKLM:\

Now you can browse the registry :

HKLM:\> Get-Childitem
HKLM:\> Dir SOFTWARE

Next, you can search for registry entries

HKLM:\> Get-ChildItem HKLM:\Software -recurse -include 'PowerShell' -ErrorAction SilentlyContinue

Or you can get a specific value :

PS> $key = 'HKLM:\SOFTWARE\Microsoft\PowerShell\3\'
PS> (Get-ItemProperty -Path $key).Install

 

About Nicolas 282 Articles
I work as an IT Production Manager, based in Paris (France) with a primary focus on Microsoft technologies. I have 10 years experience in administering Windows Servers. . I am a Microsoft MVP for Cloud & Datacenter Management. I also received the PowerShell Hero 2016 award by PowerShell.0rg. And finally, I am "MCSE: Cloud Platform and Infrastructure", "MCSA: Windows Servers", "Administering & Deploying SCCM", and CheckPoint CCSA certified.