Skip to content

Latest commit

 

History

History
36 lines (30 loc) · 1.28 KB

File metadata and controls

36 lines (30 loc) · 1.28 KB

Read-OZORegistryKeyNameValue

This function is part of the OZORegistry PowerShell Module.

Description

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.

Syntax

Read-OZORegistryKeyNameValue
    -Key  <String>
    -Name <String>

Parameters

Parameter Description
Key The registry key.
Name The key name.

Examples

Example 1

Read-OZORegistryKeyNameValue -Key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion" -Name "ProgramFilesDir"
C:\Program Files

Example 2

Read-OZORegistryKeyNameValue -Key "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion" -Name "ProgramFilesDir"
C:\Program Files

Outputs

Byte[] | Int32 | Int64 | String | String[]

Logging

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.