formats/adbackup.format.ps1xml

<?xml version="1.0" encoding="UTF-8"?>
<!--
Format type data generated 03/24/2021 13:51:54 by COMPANY\artd
 
This file was created using the New-PSFormatXML command that is part
of the PSScriptTools module.
https://github.com/jdhitsolutions/PSScriptTools
-->
<Configuration>
  <ViewDefinitions>
    <View>
      <!--Created 03/24/2021 13:51:54 by COMPANY\artd-->
      <Name>default</Name>
      <ViewSelectedBy>
        <TypeName>ADBackupStatus</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <PropertyName>DomainController</PropertyName>
        <Label>DomainController</Label>
      </GroupBy>
      <TableControl>
        <!--Delete the AutoSize node if you want to use the defined widths.
        <AutoSize />-->
        <TableHeaders>
          <TableColumnHeader>
            <Label>Partition</Label>
            <Width>50</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>LocalUSN</Label>
            <Width>9</Width>
            <Alignment>right</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>OriginUSN</Label>
            <Width>9</Width>
            <Alignment>right</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Date</Label>
            <Width>23</Width>
            <Alignment>right</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Partition</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>LocalUSN</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>OriginatingUSN</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
                If ($host.name -match 'console') {
                  if ($_.age.TotalDays -ge $ADReportingHash.BackupLimit) {
                    "$($ADReportingToolsOptions.Alert)$($_.Date)$([char]0x1b)[0m"
                  }
                  else {
                    $_.Date
                  }
                }
                else {
                   $_.Date
                }
                </ScriptBlock>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <!--Created 03/24/2021 14:28:12 by COMPANY\artd-->
      <Name>age</Name>
      <ViewSelectedBy>
        <TypeName>ADBackupStatus</TypeName>
      </ViewSelectedBy>
            <GroupBy>
        <PropertyName>DomainController</PropertyName>
        <Label>DomainController</Label>
      </GroupBy>
      <TableControl>
        <!--Delete the AutoSize node if you want to use the defined widths.
        <AutoSize />-->
        <TableHeaders>
          <TableColumnHeader>
            <Label>Partition</Label>
            <Width>50</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Age</Label>
            <Width>22</Width>
            <Alignment>right</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Partition</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>$_.Age.ToString() -replace "\.\d+$",""</ScriptBlock>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
  </ViewDefinitions>
</Configuration>