RabbitMqTools.Format.Ps1xml

<?xml version="1.0" encoding="utf-8" ?>
    
<Configuration>
    <ViewDefinitions>
        <!-- RabbitMQ.VirtualHost -->
        <View>
            <Name>RabbitMQ</Name>
            <ViewSelectedBy>
                <TypeName>RabbitMQ.VirtualHost</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label>Name</Label>
                        <Width>60</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Messages</Label>
                        <Width>8</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Messages ready</Label>
                        <Width>8</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Messages unacked</Label>
                        <Width>8</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <PropertyName>name</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>messages</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>messages_ready</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>messages_unacknowledged</PropertyName>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>

        <!-- RabbitMQ.ServerOverview -->
        <View>
            <Name>RabbitMQ</Name>
            <ViewSelectedBy>
                <TypeName>RabbitMQ.ServerOverview</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label>Ver.</Label>
                        <Width>6</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Erlang ver.</Label>
                        <Width>7</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Mgm ver.</Label>
                        <Width>6</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Server</Label>
                        <Width>20</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Node</Label>
                        <Width>20</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Messages total</Label>
                        <Width>8</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Messages ready</Label>
                        <Width>8</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Messages unacked</Label>
                        <Width>8</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>

                    <TableColumnHeader>
                        <Label>Consumers</Label>
                        <Width>11</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Queues</Label>
                        <Width>6</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Exchanges</Label>
                        <Width>9</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Connections</Label>
                        <Width>11</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Channels</Label>
                        <Width>8</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>

                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <PropertyName>rabbitmq_version</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>erlang_version</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>management_version</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>HostName</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>node</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>$_.queue_totals.messages</ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>$_.queue_totals.messages_ready</ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>$_.queue_totals.messages_unacknowledged</ScriptBlock>
                            </TableColumnItem>

                            <TableColumnItem>
                                <ScriptBlock>$_.object_totals.consumers</ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>$_.object_totals.queues</ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>$_.object_totals.exchanges</ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>$_.object_totals.connections</ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>$_.object_totals.connections</ScriptBlock>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>

        <!-- RabbitMQ.Exchange -->
        <View>
            <Name>RabbitMQ</Name>
            <ViewSelectedBy>
                <TypeName>RabbitMQ.Exchange</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label>Computer name</Label>
                        <Width>15</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>VHost</Label>
                        <Width>15</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Name</Label>
                        <Width>30</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Type</Label>
                        <Width>8</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Parameters</Label>
                        <Width>10</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <PropertyName>HostName</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>vhost</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>name</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>type</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>
                                    [String]::Format("{0} {1} {2} {3}", @{$true="D"; $false=" "}[$_.durable], @{$true="AD"; $false=" "}[$_.auto_delete], @{$true="I"; $false=" "}[$_.internal], @{$true=" "; $false="AE"}[-not ($_.arguments)."alternate-exchange"])
                                </ScriptBlock>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>

        <!-- RabbitMQ.Connection -->
        <View>
            <Name>RabbitMQ</Name>
            <ViewSelectedBy>
                <TypeName>RabbitMQ.Connection</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label>Computer name</Label>
                        <Width>15</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>VHost</Label>
                        <Width>15</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Name</Label>
                        <Width>30</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Node</Label>
                        <Width>15</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>State</Label>
                        <Width>10</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <PropertyName>HostName</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>vhost</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>name</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>Node</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>State</PropertyName>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>

        <!-- RabbitMQ.Node -->
        <View>
            <Name>RabbitMQ</Name>
            <ViewSelectedBy>
                <TypeName>RabbitMQ.Node</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label>Computer name</Label>
                        <Width>15</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Node</Label>
                        <Width>40</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Memory</Label>
                        <Width>15</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Disc</Label>
                        <Width>15</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Proc.</Label>
                        <Width>10</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <PropertyName>HostName</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>
                                    [String]::Format("{0} {1}", $_.name, @{$true=""; $false="(stopped)"}[$_.running])
                                </ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>mem_used</PropertyName>
                                <FormatString>{0:##,#}</FormatString>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>disk_free</PropertyName>
                                <FormatString>{0:##,#}</FormatString>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>proc_used</PropertyName>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>

        <!-- RabbitMQ.Channel -->
        <View>
            <Name>RabbitMQ</Name>
            <ViewSelectedBy>
                <TypeName>RabbitMQ.Channel</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label>Computer name</Label>
                        <Width>15</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>VHost</Label>
                        <Width>15</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Name</Label>
                        <Width>40</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Prefetch</Label>
                        <Width>15</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>flow</Label>
                        <Width>7</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Unacked</Label>
                        <Width>10</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Unconfirmed</Label>
                        <Width>11</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <PropertyName>HostName</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>vhost</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>name</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>prefetch_count</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>
                                    [String]::Format("{0}", @{$true="blocked"; $false=""}[$_.client_flow_blocked])
                                </ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>messages_unacknowledged</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>messages_unconfirmed</PropertyName>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>

        <!-- RabbitMQ.Queue -->
        <View>
            <Name>Standard</Name>
            <ViewSelectedBy>
                <TypeName>RabbitMQ.Queue</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label>Name</Label>
                        <Width>34</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>VHost</Label>
                        <Width>25</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Params</Label>
                        <Width>15</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Messages </Label>
                        <Width>11</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Unacked </Label>
                        <Width>11</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Memory </Label>
                        <Width>18</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <PropertyName>name</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>vhost</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>
                                    $p = @()
                                    if ($_.durable) { $p += "D" }
                                    if ($_.auto_delete) { $p += "AD" }
                                    if ($_.arguments."x-dead-letter-exchange") { $p += "DLX" }
                                    if ($_.arguments."x-message-ttl") { $p += "TTL" }
                                    
                                    $p -join ','
                                </ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>messages</PropertyName>
                                <FormatString>{0:#,0}</FormatString>
                                <Alignment>right</Alignment>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>messages_unacknowledged</PropertyName>
                                <FormatString>{0:#,0}</FormatString>
                                <Alignment>right</Alignment>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>memory</PropertyName>
                                <FormatString>{0:#,0} B</FormatString>
                                <Alignment>right</Alignment>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>

        <!-- RabbitMQ.Queue - stats view -->
        <View>
            <Name>Stats</Name>
            <ViewSelectedBy>
                <TypeName>RabbitMQ.Queue</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label>Name</Label>
                        <Width>30</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>VHost</Label>
                        <Width>25</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>

                    <TableColumnHeader>
                        <Label>Messages </Label>
                        <Width>11</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Unacked </Label>
                        <Width>11</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>

                    <TableColumnHeader>
                        <Label>Incoming </Label>
                        <Width>12</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Deliver\Get </Label>
                        <Width>12</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Ack </Label>
                        <Width>12</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>

                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <PropertyName>name</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>vhost</PropertyName>
                            </TableColumnItem>

                            <TableColumnItem>
                                <PropertyName>messages</PropertyName>
                                <FormatString>{0:#,0}</FormatString>
                                <Alignment>right</Alignment>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>messages_unacknowledged</PropertyName>
                                <FormatString>{0:#,0}</FormatString>
                                <Alignment>right</Alignment>
                            </TableColumnItem>

                            <TableColumnItem>
                                <ScriptBlock>
                                    $s = $_ | select -ExpandProperty backing_queue_status
                                    $s.avg_ingress_rate
                                </ScriptBlock>
                                <FormatString>{0:#,0}\s</FormatString>
                                <Alignment>right</Alignment>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>
                                    $s = $_ | select -ExpandProperty backing_queue_status
                                    $s.avg_egress_rate
                                </ScriptBlock>
                                <FormatString>{0:#,0}\s</FormatString>
                                <Alignment>right</Alignment>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>
                                    $s = $_ | select -ExpandProperty backing_queue_status
                                    $s.avg_ack_egress_rate
                                </ScriptBlock>
                                <FormatString>{0:#,0}\s</FormatString>
                                <Alignment>right</Alignment>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>

        <!-- RabbitMQ.QueueBinding -->
        <View>
            <Name>Standard</Name>
            <ViewSelectedBy>
                <TypeName>RabbitMQ.QueueBinding</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label>VHost</Label>
                        <Width>25</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Exchange</Label>
                        <Width>20</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Queue</Label>
                        <Width>35</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Routing key</Label>
                        <Width>20</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <PropertyName>vhost</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>source</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>destination</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>routing_key</PropertyName>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>

        <!-- RabbitMQ.QueueMessage -->
        <View>
            <Name>Standard</Name>
            <ViewSelectedBy>
                <TypeName>RabbitMQ.QueueMessage</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label> #</Label>
                        <Width>3</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Queue</Label>
                        <Width>20</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>R</Label>
                        <Width>1</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Payload</Label>
                        <Width>95</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <PropertyName>no</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>QueueName</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>@{$true="*";$false=" "}[$_.redelivered]</ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>payload</PropertyName>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>

        <View>
            <Name>Details</Name>
            <ViewSelectedBy>
                <TypeName>RabbitMQ.QueueMessage</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label> #</Label>
                        <Width>3</Width>
                        <Alignment>right</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Server</Label>
                        <Width>20</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>VHost</Label>
                        <Width>20</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Exchange</Label>
                        <Width>20</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Queue</Label>
                        <Width>20</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Routing key</Label>
                        <Width>20</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>R</Label>
                        <Width>1</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Payload size</Label>
                        <Width>10</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Payload enconding</Label>
                        <Width>10</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <PropertyName>no</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>HostName</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>VirtualHost</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>Exchange</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>QueueName</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>routing_key</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>@{$true="*";$false=" "}[$_.redelivered]</ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>payload_bytes</PropertyName>
                                <Alignment>right</Alignment>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>payload_encoding</PropertyName>
                                <Alignment>center</Alignment>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>
        
        <View>
            <Name>Payload</Name>
            <ViewSelectedBy>
                <TypeName>RabbitMQ.QueueMessage</TypeName>
            </ViewSelectedBy>

            <CustomControl>
              <CustomEntries>
                <CustomEntry>
                  <CustomItem>
                    <NewLine/>
                    <ExpressionBinding>
                        <ScriptBlock>
                            "Message #$($_.no):"
                        </ScriptBlock>
                    </ExpressionBinding>
                    <NewLine/>
                    <Text>--------------------</Text>
                    <NewLine/>
                    <ExpressionBinding>
                        <ScriptBlock>
                            $q = $_.Payload | ConvertFrom-Json
                            $w = $q | gm | ? MemberType -like '*property*'
                            $l = $w | select -ExpandProperty Name | sort length | select * -Last 1
                            
                            $s = "" #"Message #$($_.no):`r`n--------------------`r`n"
                            foreach ($i in $w)
                            {
                                $s += [string]::Format(" {0,-$($l.Length)} : {1}`r`n", $i.Name, $q."$($i.Name)")
                            }
                            
                            $s
                        </ScriptBlock>
                    </ExpressionBinding>
                  </CustomItem>
                </CustomEntry>
              </CustomEntries>
            </CustomControl>
        </View>

        <!-- RabbitMQ.User -->
        <View>
            <Name>Default</Name>
            <ViewSelectedBy>
                <TypeName>RabbitMQ.User</TypeName>
            </ViewSelectedBy>
            <GroupBy>
                <PropertyName>HostName</PropertyName>
            </GroupBy>
            <TableControl>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label>Name</Label>
                        <Width>50</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Tags</Label>
                        <Width>30</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <PropertyName>name</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>tags</PropertyName>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>

        <View>
            <Name>Flat</Name>
            <ViewSelectedBy>
                <TypeName>RabbitMQ.User</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label>HostName</Label>
                        <Width>20</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Name</Label>
                        <Width>50</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Tags</Label>
                        <Width>30</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <PropertyName>HostName</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>name</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>tags</PropertyName>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>
        
        <!-- RabbitMQ.Permission -->
        <View>
            <Name>Default</Name>
            <ViewSelectedBy>
                <TypeName>RabbitMQ.Permission</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label>Computer</Label>
                        <Width>20</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>vhost</Label>
                        <Width>30</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>user</Label>
                        <Width>30</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Configure</Label>
                        <Width>10</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Read </Label>
                        <Width>10</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Write </Label>
                        <Width>10</Width>
                        <Alignment>left</Alignment>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <PropertyName>HostName</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>vhost</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>user</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>configure</PropertyName>
                                <Alignment>center</Alignment>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>read</PropertyName>
                                <Alignment>center</Alignment>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>write</PropertyName>
                                <Alignment>center</Alignment>
                            </TableColumnItem>

                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>
    </ViewDefinitions>
</Configuration>