formats/serviceansi.format.ps1xml

<?xml version="1.0" encoding="UTF-8"?>
<!--
format type data generated 02/03/2020 14:51:45 by BOVINE320\Jeff
-->
<Configuration>
  <ViewDefinitions>
      <View>
        <!--Created 02/03/2020 14:51:45 by BOVINE320\Jeff-->
        <Name>service</Name>
        <ViewSelectedBy>
          <TypeName>System.Service.ServiceController#StartupType</TypeName>
        </ViewSelectedBy>
        <TableControl>
          <!--Delete the AutoSize node if you want to use the defined widths.-->
          <TableHeaders>
            <TableColumnHeader>
              <Label>Status</Label>
              <Width>8</Width>
              <Alignment>left</Alignment>
            </TableColumnHeader>
            <TableColumnHeader>
              <Label>Name</Label>
              <Width>18</Width>
              <Alignment>left</Alignment>
            </TableColumnHeader>
            <TableColumnHeader>
              <Label>DisplayName</Label>
              <Width>42</Width>
              <Alignment>left</Alignment>
            </TableColumnHeader>
          </TableHeaders>
          <TableRowEntries>
            <TableRowEntry>
              <TableColumnItems>
                <TableColumnItem>
                 <PropertyName>Status</PropertyName>
                </TableColumnItem>
                <TableColumnItem>
                  <PropertyName>Name</PropertyName>
                </TableColumnItem>
                <TableColumnItem>
                  <PropertyName>DisplayName</PropertyName>
                </TableColumnItem>
              </TableColumnItems>
            </TableRowEntry>
          </TableRowEntries>
        </TableControl>
      </View>
<View>
<!--Created 02/03/2020 14:51:45 by BOVINE320\Jeff-->
      <Name>Ansi</Name>
      <ViewSelectedBy>
        <TypeName>System.Service.ServiceController#StartupType</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <!--Delete the AutoSize node if you want to use the defined widths.-->
        <TableHeaders>
          <TableColumnHeader>
            <Label>Status</Label>
            <Width>8</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Name</Label>
            <Width>18</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>DisplayName</Label>
            <Width>42</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <ScriptBlock>
                 If ($_.status -eq "stopped") {
                   "`e[38;2;197;15;31m$($_.status)`e[0m"
                  }
                  elseif ($_.status -eq "running") {
                    "`e[38;2;19;161;14m$($_.status)`e[0m"
                  }
                  elseif ($_.status -eq "paused") {
                    "`e[38;2;252;127;0m$($_.status)`e[0m"
                  }
                  else {
                    $_.status
                  }
                </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>DisplayName</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
  </ViewDefinitions>
</Configuration>