HexDump-Help.xml

<?xml version="1.0" encoding="utf-8"?>
<helpItems xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" schema="maml" xmlns="http://msh">
  <command:command>
    <command:details>
      <command:name>Write-HexDump</command:name>
      <maml:description>
        <maml:para>Dump the data hexadecimal.</maml:para>
      </maml:description>
      <command:verb>Write</command:verb>
      <command:noun>HexDump</command:noun>
    </command:details>
    <maml:description>
      <maml:para>Like the `hexdump` Unix-like command, it reads a given byte sequence, stream, or file and dumps it hexadecimal. It also outputs the result of the text conversion of the byte sequence.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Write-HexDump</maml:name>
        <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="d">
          <maml:name>Data</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">byte[]</command:parameterValue>
          <dev:type>
            <maml:name>System.Byte[]</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none">
          <maml:name>Config</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">Config</command:parameterValue>
          <dev:type>
            <maml:name>MT.HexDump.Config</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="e">
          <maml:name>Encoding</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">Encoding</command:parameterValue>
          <dev:type>
            <maml:name>System.Text.Encoding</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none">
          <maml:name>Offset</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">long</command:parameterValue>
          <dev:type>
            <maml:name>System.Int64</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none">
          <maml:name>Length</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">int</command:parameterValue>
          <dev:type>
            <maml:name>System.Int32</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="f">
          <maml:name>Format</maml:name>
          <maml:description />
          <command:parameterValueGroup>
            <command:parameterValue required="false" variableLength="false">SplitHexAndChars</command:parameterValue>
            <command:parameterValue required="false" variableLength="false">UnifyHexAndChars</command:parameterValue>
          </command:parameterValueGroup>
          <command:parameterValue required="true" variableLength="false">string</command:parameterValue>
          <dev:type>
            <maml:name>System.String</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="c">
          <maml:name>Color</maml:name>
          <maml:description />
          <command:parameterValueGroup>
            <command:parameterValue required="false" variableLength="false">None</command:parameterValue>
            <command:parameterValue required="false" variableLength="false">ByByte</command:parameterValue>
            <command:parameterValue required="false" variableLength="false">ByUnicodeCategory</command:parameterValue>
            <command:parameterValue required="false" variableLength="false">ByCharType</command:parameterValue>
          </command:parameterValueGroup>
          <command:parameterValue required="true" variableLength="false">ColorType</command:parameterValue>
          <dev:type>
            <maml:name>MT.HexDump.ColorType</maml:name>
          </dev:type>
        </command:parameter>
      </command:syntaxItem>
      <command:syntaxItem>
        <maml:name>Write-HexDump</maml:name>
        <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="none">
          <maml:name>Stream</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">Stream</command:parameterValue>
          <dev:type>
            <maml:name>System.IO.Stream</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none">
          <maml:name>Config</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">Config</command:parameterValue>
          <dev:type>
            <maml:name>MT.HexDump.Config</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="e">
          <maml:name>Encoding</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">Encoding</command:parameterValue>
          <dev:type>
            <maml:name>System.Text.Encoding</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none">
          <maml:name>Offset</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">long</command:parameterValue>
          <dev:type>
            <maml:name>System.Int64</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none">
          <maml:name>Length</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">int</command:parameterValue>
          <dev:type>
            <maml:name>System.Int32</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="f">
          <maml:name>Format</maml:name>
          <maml:description />
          <command:parameterValueGroup>
            <command:parameterValue required="false" variableLength="false">SplitHexAndChars</command:parameterValue>
            <command:parameterValue required="false" variableLength="false">UnifyHexAndChars</command:parameterValue>
          </command:parameterValueGroup>
          <command:parameterValue required="true" variableLength="false">string</command:parameterValue>
          <dev:type>
            <maml:name>System.String</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="c">
          <maml:name>Color</maml:name>
          <maml:description />
          <command:parameterValueGroup>
            <command:parameterValue required="false" variableLength="false">None</command:parameterValue>
            <command:parameterValue required="false" variableLength="false">ByByte</command:parameterValue>
            <command:parameterValue required="false" variableLength="false">ByUnicodeCategory</command:parameterValue>
            <command:parameterValue required="false" variableLength="false">ByCharType</command:parameterValue>
          </command:parameterValueGroup>
          <command:parameterValue required="true" variableLength="false">ColorType</command:parameterValue>
          <dev:type>
            <maml:name>MT.HexDump.ColorType</maml:name>
          </dev:type>
        </command:parameter>
      </command:syntaxItem>
      <command:syntaxItem>
        <maml:name>Write-HexDump</maml:name>
        <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="none">
          <maml:name>Path</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">string</command:parameterValue>
          <dev:type>
            <maml:name>System.String</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none">
          <maml:name>Config</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">Config</command:parameterValue>
          <dev:type>
            <maml:name>MT.HexDump.Config</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="e">
          <maml:name>Encoding</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">Encoding</command:parameterValue>
          <dev:type>
            <maml:name>System.Text.Encoding</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none">
          <maml:name>Offset</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">long</command:parameterValue>
          <dev:type>
            <maml:name>System.Int64</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none">
          <maml:name>Length</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">int</command:parameterValue>
          <dev:type>
            <maml:name>System.Int32</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="f">
          <maml:name>Format</maml:name>
          <maml:description />
          <command:parameterValueGroup>
            <command:parameterValue required="false" variableLength="false">SplitHexAndChars</command:parameterValue>
            <command:parameterValue required="false" variableLength="false">UnifyHexAndChars</command:parameterValue>
          </command:parameterValueGroup>
          <command:parameterValue required="true" variableLength="false">string</command:parameterValue>
          <dev:type>
            <maml:name>System.String</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="c">
          <maml:name>Color</maml:name>
          <maml:description />
          <command:parameterValueGroup>
            <command:parameterValue required="false" variableLength="false">None</command:parameterValue>
            <command:parameterValue required="false" variableLength="false">ByByte</command:parameterValue>
            <command:parameterValue required="false" variableLength="false">ByUnicodeCategory</command:parameterValue>
            <command:parameterValue required="false" variableLength="false">ByCharType</command:parameterValue>
          </command:parameterValueGroup>
          <command:parameterValue required="true" variableLength="false">ColorType</command:parameterValue>
          <dev:type>
            <maml:name>MT.HexDump.ColorType</maml:name>
          </dev:type>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="c">
        <maml:name>Color</maml:name>
        <maml:description>
          <maml:para>Color scheme settings for hexadecimal dump columns and textualized columns</maml:para>
          <maml:para>- `None`: no color
- `ByByte`: color scheme based on byte values
- `ByUnicodeCategory`: color scheme based on Unicode categories
- `ByCharType`: color scheme based on ASCII control characters, ASCII characters and multi-byte characters values that could not be decoded into characters, etc.
</maml:para>
          <maml:para>It overrides the `Config` setting.</maml:para>
        </maml:description>
        <command:parameterValueGroup>
          <command:parameterValue required="false" variableLength="false">None</command:parameterValue>
          <command:parameterValue required="false" variableLength="false">ByByte</command:parameterValue>
          <command:parameterValue required="false" variableLength="false">ByUnicodeCategory</command:parameterValue>
          <command:parameterValue required="false" variableLength="false">ByCharType</command:parameterValue>
        </command:parameterValueGroup>
        <command:parameterValue required="true" variableLength="true">MT.HexDump.ColorType</command:parameterValue>
        <dev:type>
          <maml:name>MT.HexDump.ColorType</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="none">
        <maml:name>Config</maml:name>
        <maml:description>
          <maml:para>A set of settings including encoding, color scheme settings, etc.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">MT.HexDump.Config</command:parameterValue>
        <dev:type>
          <maml:name>MT.HexDump.Config</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="d">
        <maml:name>Data</maml:name>
        <maml:description>
          <maml:para>Byte array to be dumped</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">System.Byte[]</command:parameterValue>
        <dev:type>
          <maml:name>System.Byte[]</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="e">
        <maml:name>Encoding</maml:name>
        <maml:description>
          <maml:para>Encoding used to decode byte strings into characters</maml:para>
          <maml:para>You can also specify the `System.Text.Encoding` type directly, or specify a name or codepage that can be used in `System.Text.Encoding.GetEncoding(name or codepage)`.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">System.Text.Encoding</command:parameterValue>
        <dev:type>
          <maml:name>System.Text.Encoding</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="f">
        <maml:name>Format</maml:name>
        <maml:description>
          <maml:para>Output Format. The following can be specified</maml:para>
          <maml:para>- `SplitHexAndChars`
- `UnifyHexAndChars`
</maml:para>
          <maml:para>This parameter is a syntax sugar to `Write-HexDump .... | Format-Table -view {format name}`.</maml:para>
          <maml:para>If you wish to store the dump output results in a variable, it is recommended that you do not specify this parameter.</maml:para>
        </maml:description>
        <command:parameterValueGroup>
          <command:parameterValue required="false" variableLength="false">SplitHexAndChars</command:parameterValue>
          <command:parameterValue required="false" variableLength="false">UnifyHexAndChars</command:parameterValue>
        </command:parameterValueGroup>
        <command:parameterValue required="true" variableLength="true">System.String</command:parameterValue>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="none">
        <maml:name>Length</maml:name>
        <maml:description>
          <maml:para>Length from the dump start position to the end. If not specified, to the end.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">System.Int32</command:parameterValue>
        <dev:type>
          <maml:name>System.Int32</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="none">
        <maml:name>Offset</maml:name>
        <maml:description>
          <maml:para>Dump start position. If not specified, read from the beginning.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">System.Int64</command:parameterValue>
        <dev:type>
          <maml:name>System.Int64</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="none">
        <maml:name>Path</maml:name>
        <maml:description>
          <maml:para>Target file path to dump</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">System.String</command:parameterValue>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="none">
        <maml:name>Stream</maml:name>
        <maml:description>
          <maml:para>Stream object to be dumped. When dumping is complete, this stream object is closed (`Dispose()`).</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">System.IO.Stream</command:parameterValue>
        <dev:type>
          <maml:name>System.IO.Stream</maml:name>
        </dev:type>
      </command:parameter>
    </command:parameters>
    <command:inputTypes>
      <command:inputType>
        <dev:type>
          <maml:name>System.Byte</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>Byte sequence to dump. (See: `-Data` parameter)

Note that giving a sequence of bytes from the pipeline requires a little ingenuity.
You will need to add a `NoEnumerate` parameter to `Write-Output` (Alias: `echo`).

```powershell
$bytes = @(...)
Write-Output -NoEnumerate $bytes | Write-HexDump ...
```</maml:para>
        </maml:description>
      </command:inputType>
      <command:inputType>
        <dev:type>
          <maml:name>System.IO.Stream</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>The stream object to dump. (See: `-Stream` parameter)</maml:para>
        </maml:description>
      </command:inputType>
      <command:inputType>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>File path to dump. (See: `-Path` parameter)</maml:para>
        </maml:description>
      </command:inputType>
    </command:inputTypes>
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>MT.HexDump.CharCollectionRow</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>Row objects containing 16 bytes of information each</maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para />
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>--------- Example 1. List ASCII codes ---------</maml:title>
        <maml:introduction />
        <dev:code>```powershell
hexdump -Data @(0x00..0x7F)
```</dev:code>
        <dev:remarks>
          <maml:para>Output:</maml:para>
          <maml:para>```
Row Hex 2 3 4 5 6 7 8 9 A B C D E F C 1 2 3 4 5 6 7 8 9 A B C D E F
--- ---------------------------------------------- -------------------------------
0x00000000 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ␀ ␁ ␂ ␃ ␄ ␅ ␆ ␇ ␈ ␉ ␊ ␋ ␌ ␍ ␎ ␏
0x00000010 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F ␐ ␑ ␒ ␓ ␔ ␕ ␖ ␗ ␘ ␙ ␚ ␛ ␜ ␝ ␞ ␟
0x00000020 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F ! " # $ % &amp; ' ( ) * + , - . /
0x00000030 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 0 1 2 3 4 5 6 7 8 9 : ; &lt; = &gt; ?
0x00000040 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F @ A B C D E F G H I J K L M N O
0x00000050 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F P Q R S T U V W X Y Z [ \ ] ^ _
0x00000060 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F ` a b c d e f g h i j k l m n o
0x00000070 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F p q r s t u v w x y z { | } ~ ␡

```</maml:para>
          <maml:para />
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>--------- Example 2. Hexadecimal dump and textualized data in one column ---------</maml:title>
        <maml:introduction />
        <dev:code>```powershell
hexdump -Data @(0x00..0x7F) -Format UnifyHexAndChars
```</dev:code>
        <dev:remarks>
          <maml:para>Output:</maml:para>
          <maml:para>```
Row Hex and Letters
--- ---------------
0x00000000 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
           ␀ ␁ ␂ ␃ ␄ ␅ ␆ ␇ ␈ ␉ ␊ ␋ ␌ ␍ ␎ ␏
0x00000010 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
           ␐ ␑ ␒ ␓ ␔ ␕ ␖ ␗ ␘ ␙ ␚ ␛ ␜ ␝ ␞ ␟
0x00000020 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
              ! " # $ % &amp; ' ( ) * + , - . /
0x00000030 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
           0 1 2 3 4 5 6 7 8 9 : ; &lt; = &gt; ?
0x00000040 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
           @ A B C D E F G H I J K L M N O
0x00000050 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
           P Q R S T U V W X Y Z [ \ ] ^ _
0x00000060 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
           ` a b c d e f g h i j k l m n o
0x00000070 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
           p q r s t u v w x y z { | } ~ ␡
```</maml:para>
          <maml:para />
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version</maml:linkText>
        <maml:uri />
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
</helpItems>