How to Find Registry Key in PowerShell

MD Aminul Islam Feb 15, 2024
  1. Get the Specific Registry Name in PowerShell
  2. Get the Specific Registry Value in PowerShell
How to Find Registry Key in PowerShell

The registry key is a very important part of Windows, containing settings and information for hardware, software, users, etc. It works like a database.

In Windows, we have a Registry Editor to edit, modify or create Registry Keys or Parameters.

But we also can do a similar task by using PowerShell. The Windows PowerShell contains all the necessary tools to perform any task regarding the registry key.

Sometimes we need to search for the specific Registry key and its value. In this article, we will see how we can search for specific registry keys and their value using Windows PowerShell.

Also, we will discuss the topic by using necessary examples and explanations to make the topic easier.

The general syntax for finding the value or details of any registry element is as follows:

Get-ItemProperty -Path 'HKLM:YOUR PATH TO REGISTRY' -Name "PROVIDE YOUR REGISTRY NAME"

Get the Specific Registry Name in PowerShell

In our below example, we will find the details of the OpacityCoefficientPercentage registry located in HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Capture\.

Now the code for our example will be like the one below.

Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Capture\' -Name "OpacityCoefficientPercentage"

After running the above example command, you will get an output in your PowerShell window like the one below.

Get-ItemProperty -Path command

Get the Specific Registry Value in PowerShell

In this example, we will find the value of the OpacityCoefficientPercentage registry located in HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Capture\.

Now the code for our example will be like the one below.

Get-ItemPropertyValue -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Capture\' -Name "OpacityCoefficientPercentage"

After running the above example command, you will get an output in your PowerShell window like the one below.

100

In the examples above:

  1. Get-ItemProperty - This will let you get the whole details of the Registry.
  2. Get-ItemPropertyValue - This will let you get the current value of the Registry.
  3. -Path - This will specify the path to the command.
  4. -Name - This will specify the item’s name to the command.

Remember, you need to provide the path and the name of the specific registry in the command.

MD Aminul Islam avatar MD Aminul Islam avatar

Aminul Is an Expert Technical Writer and Full-Stack Developer. He has hands-on working experience on numerous Developer Platforms and SAAS startups. He is highly skilled in numerous Programming languages and Frameworks. He can write professional technical articles like Reviews, Programming, Documentation, SOP, User manual, Whitepaper, etc.

LinkedIn

Related Article - PowerShell Registry