Search notes:

PowerShell cmdLet Format-Hex

format-hex can be used to display data in hexadecimal. This cmdLet returns an array of Microsoft.PowerShell.Commands.ByteCollection objects.
PS C:\> 'René' | format-hex


           00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000000   52 65 6E 3F                                      Ren?

PS C:\> [System.Text.Encoding]::UTF8.GetBytes('René') | format-hex

           Path:

           00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000000   52 65 6E C3 A9                                   René
The content of a file can be displayed by specifing the -path parameter with the name of a file:
PS C:\> format-hex -path readme.txt

See also

A number might also be displayed in hexadecimal representation using the -f operator and the {…:x] format specifier:
PS C:\> $num = 257
PS C:\> '{0:x}' -f $num
101
Using the get-content cmdLet to display a hexadecimal representation of a file.
format-hex belongs to the cmdlets with the -encoding parameter.
Powershell command noun: hex
The (Linux) shell command od

Index