Formats/JsonPatch.Operations.Operation.Format.ps1xml

<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
    <ViewDefinitions>
        <View>
            <Name>Default</Name>
            <ViewSelectedBy>
                <TypeName>Microsoft.AspNetCore.JsonPatch.Operations.Operation</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label>OperationType</Label>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Path</Label>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Value</Label>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>From</Label>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <ScriptBlock>
                                    $color = switch ($_.OperationType) {
                                        "Remove" { 31 }
                                        "Add" { 32 }
                                        "Replace" { 33 }
                                        "Copy" { 34 }
                                        "Move" { 35 }
                                        "Test" { 0 }
                                    }
                                    "$([char]0x001b)[$($color)m" + $_.OperationType
                                </ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>Path</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>Value</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>$_.From + "$([char]0x001b)[0m"</ScriptBlock>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>
    </ViewDefinitions>
</Configuration>