UncommonSense.P2000.Format.ps1xml

<Configuration>
    <ViewDefinitions>
        <View>
            <Name>Default</Name>
            <ViewSelectedBy>
                <TypeName>UncommonSense.P2000.Entry</TypeName>
            </ViewSelectedBy>
            <GroupBy>
                <Label>Date/Time</Label>
                <ScriptBlock>
                    $FromHour = Get-Date $_.DateTime -Minute 0 -Second 0 -MilliSecond 0
                    $ToHour = Get-Date $FromHour.AddHours(1)
                    "{0:d} {0:t}..{1:t}" -f $FromHour, $ToHour
                </ScriptBlock>
            </GroupBy>
            <TableControl>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label>Service</Label>
                        <Width>10</Width>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Time</Label>
                        <Width>10</Width>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Width>100</Width>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <Wrap/>
                        <TableColumnItems>
                            <TableColumnItem>
                                <ScriptBlock>
                                $Esc = [char]27

                                if ($_.Service -eq 'Ambulance')
                                {
                                    return "$Esc[93m$($_.Service)$Esc[0m"
                                }
                                elseif ($_.Service -eq 'Brandweer')
                                {
                                    return "$Esc[91m$($_.Service)$Esc[0m"
                                }
                                elseif ($_.service -eq 'Politie')
                                {
                                    return "$Esc[34m$($_.Service)$Esc[0m"
                                }
                                else
                                {
                                    return $_.Service
                                }
                                </ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>$_.DateTime.TimeOfDay</ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>Title</PropertyName>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>
    </ViewDefinitions>
</Configuration>