Home > OS >  How do I view alphanumeric registry values with powershell
How do I view alphanumeric registry values with powershell

Time:11-20

I was working with a piece of code to retrieve only the registry value of a service I installed(Crowdstrike) which was giving me the CID value. The CID value is an alphanumeric value which when I look in regedit, I can see the correct value but when I run the code to read the registry value in powershell, I see a value which is completely different to what the actual value is. I suspect this is because the CID value is alphanumeric.

The manual regedit value is like this: enter image description here When I run the powershell command

Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CSAgent\Sim | Select-Object -ExpandProperty CU

I get the following result in powershell : 48 72 182 177 163 32 68 221 163 186 198 4 53 103 111 46. Not sure in what format this is getting picked up.

CodePudding user response:

Here you've got the hexadecilam transformation :

("48 72 182 177 163 32 68 221 163 186 198 4 53 103 111 46" -split ' ' | % {"{0:X}" -f [int]$_}) -join ' '
30 48 B6 B1 A3 20 44 DD A3 BA C6 4 35 67 6F 2E
  • Related