Skip to main content

Convert-RegistryPath

SYNOPSISโ€‹

Converts the specified registry key path to a format that is compatible with built-in PowerShell cmdlets.

SYNTAXโ€‹

Convert-RegistryPath [-Key] <String> [[-SID] <String>] [[-DisableFunctionLogging] <Boolean>]
[<CommonParameters>]

DESCRIPTIONโ€‹

Converts the specified registry key path to a format that is compatible with built-in PowerShell cmdlets.

Converts registry key hives to their full paths. Example: HKLM is converted to "Registry::HKEY_LOCAL_MACHINE".

EXAMPLESโ€‹

EXAMPLE 1โ€‹

Convert-RegistryPath -Key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1AD147D0-BE0E-3D6C-AC11-64F6DC4163F1}'

EXAMPLE 2โ€‹

Convert-RegistryPath -Key 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1AD147D0-BE0E-3D6C-AC11-64F6DC4163F1}'

PARAMETERSโ€‹

-Keyโ€‹

Path to the registry key to convert (can be a registry hive or fully qualified path)

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SIDโ€‹

The security identifier (SID) for a user. Specifying this parameter will convert a HKEY_CURRENT_USER registry key to the HKEY_USERS$SID format.

Specify this parameter from the Invoke-HKCURegistrySettingsForAllUsers function to read/edit HKCU registry settings for all users on the system.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DisableFunctionLoggingโ€‹

Disables logging of this function. Default: $true

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: True
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersโ€‹

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTSโ€‹

Noneโ€‹

You cannot pipe objects to this function.โ€‹

OUTPUTSโ€‹

System.Stringโ€‹

Returns the converted registry key path.โ€‹

NOTESโ€‹

https://psappdeploytoolkit.com