Funny Bunny
Funny Bunny

Reputation: 124

Get Registry Binary Value Power Shell

I am trying to get a registry value I tried using Get-ItemProperty -Pame -Name, but it gives me System.Byte[] instead of the value of the value itself, how can I get the hex value?

Upvotes: 0

Views: 4725

Answers (1)

Theo
Theo

Reputation: 61188

If I understand correctly, you are getting a Byte[] array from the registry and want to convert that to a Hex string, correct?

You can convert a byte array like this:

$hex = ($value | ForEach-Object { '{0:X2}' -f $_ }) -join ''

or use:

$hex = ([System.BitConverter]::ToString([byte[]]$value)).Replace('-','')

where $value is the byte array you have read from the registry

Upvotes: 2

Related Questions