formats/mytickle.format.ps1xml

<?xml version="1.0" encoding="utf-8"?>
<Configuration>
  <ViewDefinitions>
    <View>
      <Name>countdown</Name>
      <ViewSelectedBy>
        <TypeName>mytickle</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
            <Label>ID</Label>
            <Width>4</Width>
            <Alignment>Left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Event</Label>
            <Width>35</Width>
            <Alignment>Left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Comment</Label>
            <Width>20</Width>
            <Alignment>Left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Date</Label>
            <Width>23</Width>
            <Alignment>Left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Countdown</Label>
            <Width>12</Width>
            <Alignment>Right</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>ID</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
                If ($host.name -match "console|code") {
                  if ((-Not $_.Expired) -AND ($_.countdown.totaldays -le 1)) {
                       "$([char]27)[91m$($_.Event)$([char]27)[0m"
                  }
                  elseif ((-Not $_.Expired) -AND ($_.countdown.totaldays -lt 2)) {
                        "$([char]27)[93m$($_.Event)$([char]27)[0m"
                  }
                  else {
                    $_.Event
                  }
                }
                else {
                 $_.Event
                }
                </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
                If ($host.name -match "console|code") {
                  if ((-Not $_.Expired) -AND ($_.countdown.totaldays -le 1 )) {
                       "$([char]27)[91m$($_.Comment)$([char]27)[0m"
                  }
                  elseif ((-Not $_.Expired) -AND ($_.countdown.totaldays -lt 2)) {
                        "$([char]27)[93m$($_.Comment)$([char]27)[0m"
                  }
                  else {
                    $_.Comment
                  }
                }
                else {
                 $_.Comment
                }
                </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
                If ($host.name -match "console|code") {
                  if ((-Not $_.Expired) -AND ($_.countdown.totaldays -le 1)) {
                       "$([char]27)[91m$($_.Date)$([char]27)[0m"
                  }
                  elseif ((-Not $_.Expired) -AND ($_.countdown.totaldays -lt 2)) {
                        "$([char]27)[93m$($_.Date)$([char]27)[0m"
                  }
                  else {
                    $_.Date
                  }
                }
                else {
                 $_.Date
                }
                </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <Scriptblock> $count= $_.countdown.toString()
                  if ($count.lastIndexOf('.') -gt 0) {
                    $value = $count.substring(0,$count.lastIndexOf('.'))
                  }
                  else {
                    $value = $count
                  }
                  If ($host.name -match "console|code") {
                  if ((-Not $_.Expired) -AND ($_.countdown.totaldays -le 1)) {
                       "$([char]27)[91m$($value)$([char]27)[0m"
                  }
                  elseif ((-Not $_.Expired) -AND ($_.countdown.totaldays -lt 2)) {
                        "$([char]27)[93m$($value)$([char]27)[0m"
                  }
                  else {
                   $value
                    }
                  }
                  else {
                  $value
                  }
 
                </Scriptblock>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <!--Created 12/14/2020 10:23:04 by PROSPERO\Jeff-->
      <Name>date</Name>
      <ViewSelectedBy>
        <TypeName>myTickle</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <ScriptBlock>"{0:MMM yyyy}" -f $_.date</ScriptBlock>
        <Label>Month</Label>
      </GroupBy>
      <TableControl>
        <!--Delete the AutoSize node if you want to use the defined widths.
        <AutoSize />-->
        <TableHeaders>
          <TableColumnHeader>
            <Label>ID</Label>
            <Width>6</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Event</Label>
            <Width>25</Width>
            <Alignment>Left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Comment</Label>
            <Width>14</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Date</Label>
            <Width>23</Width>
            <Alignment>Left</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>ID</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Event</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Comment</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Date</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <!--Created 12/14/2020 14:45:00 by PROSPERO\Jeff-->
      <Name>default</Name>
      <ViewSelectedBy>
        <TypeName>myTickleDBInfo</TypeName>
      </ViewSelectedBy>
      <ListControl>
        <ListEntries>
          <ListEntry>
            <ListItems>
              <ListItem>
                <Label>Name</Label>
                <PropertyName>Name</PropertyName>
              </ListItem>
              <ListItem>
                <Label>Path</Label>
                <PropertyName>Path</PropertyName>
              </ListItem>
              <ListItem>
                <Label>SizeMB</Label>
                <ScriptBlock>$_.Size/1mb</ScriptBlock>
              </ListItem>
              <ListItem>
                <Label>UsedMB</Label>
                <ScriptBlock>$_.UsedSpace/1mb</ScriptBlock>
              </ListItem>
              <ListItem>
                <Label>AvailableMB</Label>
                <ScriptBlock>$_.AvailableSpace/1mb</ScriptBlock>
              </ListItem>
              <ListItem>
                <Label>LastFullbackup</Label>
                <PropertyName>LastFullBackup</PropertyName>
              </ListItem>
            </ListItems>
          </ListEntry>
        </ListEntries>
      </ListControl>
    </View>
    <View>
      <!--Created 12/14/2020 15:05:49 by PROSPERO\Jeff-->
      <Name>backup</Name>
      <ViewSelectedBy>
        <TypeName>myTickleDBInfo</TypeName>
      </ViewSelectedBy>
      <ListControl>
        <ListEntries>
          <ListEntry>
            <ListItems>
              <ListItem>
                <Label>Name</Label>
                <PropertyName>Name</PropertyName>
              </ListItem>
              <ListItem>
                <Label>LastFullBackup</Label>
                <PropertyName>LastFullBackup</PropertyName>
              </ListItem>
              <ListItem>
                <Label>LastFullBackupLocation</Label>
                <PropertyName>LastFullBackupLocation</PropertyName>
              </ListItem>
              <ListItem>
                <Label>LastDifferentialBackup</Label>
                <PropertyName>LastDifferentialBackup</PropertyName>
              </ListItem>
              <ListItem>
                <Label>LastDifferentialBackupLocation</Label>
                <PropertyName>LastDifferentialBackupLocation</PropertyName>
              </ListItem>
              <ListItem>
                <Label>LastLogBackup</Label>
                <PropertyName>LastLogBackup</PropertyName>
              </ListItem>
              <ListItem>
                <Label>LastLogBackupLocation</Label>
                <PropertyName>LastLogBackupLocation</PropertyName>
              </ListItem>
            </ListItems>
          </ListEntry>
        </ListEntries>
      </ListControl>
    </View>
  </ViewDefinitions>
</Configuration>