December 24th, 2015

PowerTip: Convert Data to Hexadecimal Output in PowerShell 5

Doctor Scripto
Scripter

Summary: Use the Format-Hex cmdlet to produce hexadecimal output.

Hey, Scripting Guy! Question How can I use Windows PowerShell to put data in a binary key in the registry?

Hey, Scripting Guy! Answer In Windows PowerShell 5.0, you can use the Format-Hex cmdlet, for example:

‘This is meant to be binary’ | Format-Hex

$DataForRegistry=(‘This is meant to be binary’ | Format-Hex).Bytes

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

1 comment

Discussion is closed. Login to edit/delete existing comments.

Newest
Newest
Popular
Oldest
  • J S

    10..15 | % tostring x
    a
    b
    c
    d
    e
    f

Feedback