This post will illustrate an in-depth guide for getting the registry key values with the help of PowerShell.
How to Get/Retrieve the Registry Key’s Value and Only the Value by Utilizing PowerShell?
These approaches can be considered to get the registry key values:
Method 1: Get/Retrieve the Registry Key’s Value and Only the Value by Utilizing “Get-ItemProperty” Command
The “Get-ItemProperty” is a command in PowerShell that is utilized to get the registry entries or values in the readable format in the console. It is specifically used to retrieve the specified registry in PowerShell.
Example
This example will retrieve only one value in the “AU” directory using the “Get-ItemProperty”:
As it can be seen that the one value has been selected and displayed in the PowerShell console.
Method 2: Get the Registry Key’s Value and Only the Value by Utilizing “Get-ItemPropertyValue” Command
The “Get-ItemPropertyValue” command in PowerShell version 5 was introduced. It is used to get the species registry query in the shortest form. This cmdlet requires only two parameters, the registry’s path, and the registry’s key.
Example
Now, we will get the registry key’s values in the short form using the “Get-ItemPropertyValue” command:
The registry key values have been displayed in the output.
Conclusion
To get/retrieve the registry keys by utilizing PowerShell, multiple methods can be utilized. These methods include “Get-ItemProperty” and “Get-ItemPropertyValue”. Both of the methods retrieve the value of a registry key using PowerShell. This post has illustrated a complete procedure to resolve the mentioned query.