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