This function is part of the OZORegistry PowerShell Module.
A simple function for returning the value for a single registry key name. Returns "Key path is not valid" if the path is not valid, "Key not found" if the path does not exist, "Could not read key names" if the key names could not be read, and "Unhandled data type" if the data cannot be returned.
Read-OZORegistryKeyNameValue
-Key <String>
-Name <String>
| Parameter | Description |
|---|---|
Key |
The registry key. |
Name |
The key name. |
Read-OZORegistryKeyNameValue -Key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion" -Name "ProgramFilesDir"
C:\Program FilesRead-OZORegistryKeyNameValue -Key "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion" -Name "ProgramFilesDir"
C:\Program FilesByte[] | Int32 | Int64 | String | String[]
Messages as written to the Windows Event Viewer One Zero One provider when available. Otherwise, messages are written to the Microsoft-Windows-PowerShell provider under event ID 4100.