formats/psprojectstatus.format.ps1xml

<!--
Format type data generated 02/04/2022 12:19:25 by PROSPERO\Jeff
 
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 02/04/2022 12:19:25 by PROSPERO\Jeff-->
      <Name>default</Name>
      <ViewSelectedBy>
        <TypeName>PSProject</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <ScriptBlock>"{0} [{1}]" -f $_.Name,$_.path</ScriptBlock>
        <Label>Name</Label>
      </GroupBy>
      <TableControl>
        <!--Delete the AutoSize node if you want to use the defined widths.
        <AutoSize />-->
        <TableHeaders>
          <TableColumnHeader>
            <Label>LastUpdate</Label>
            <Width>22</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Status</Label>
            <Width>17</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Tasks</Label>
            <Width>20</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>GitBranch</Label>
            <Width>10</Width>
            <Alignment>right</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Age</Label>
            <Width>10</Width>
            <Alignment>right</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>LastUpdate</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
                  if ($host.name -match 'console|code') {
                   <!-- display status in color-->
                   if ($_.status -eq 'Development') {
                     <!--red-->
                     "$([char]27)[91m$($_.status)$([char]27)[0m"
                    }
                    elseif ($_.status -eq 'Updating') {
                      <!--yellow-->
                      "$([char]27)[93m$($_.status)$([char]27)[0m"
                    }
                    elseif ($_.status -eq 'Stable') {
                      <!--green-->
                     "$([char]27)[92m$($_.status)$([char]27)[0m"
                     }
                     elseif ($_.status -eq 'Archive') {
                      <!--orange-->
                     "$([char]27)[38;5;214m$($_.status)$([char]27)[0m"
                     }
                     else {
                       $_.status
                     }
                   }
                  else {
                    $_.Status
                  }
                </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Tasks</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>GitBranch</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>"{0:dd\.hh\:mm}" -f $_.age</ScriptBlock>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <!--Created 03/15/2022 10:55:02 by THINKX1-JH\Jeff-->
      <Name>default</Name>
      <ViewSelectedBy>
        <TypeName>PSProject</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <ScriptBlock>"{0} [{1}]" -f $_.Name,$_.path</ScriptBlock>
        <Label>Project</Label>
      </GroupBy>
      <ListControl>
        <ListEntries>
          <ListEntry>
            <ListItems>
              <ListItem>
                <Label>Version</Label>
                <PropertyName>ProjectVersion</PropertyName>
              </ListItem>
                <ListItem>
                <Label>Status</Label>
                <PropertyName>Status</PropertyName>
              </ListItem>
              <ListItem>
                <Label>Tasks</Label>
                <PropertyName>Tasks</PropertyName>
              </ListItem>
              <ListItem>
                <Label>GitBranch</Label>
                <PropertyName>GitBranch</PropertyName>
              </ListItem>
              <ListItem>
                <Label>LastUpdate</Label>
                <PropertyName>LastUpdate</PropertyName>
              </ListItem>
            </ListItems>
          </ListEntry>
        </ListEntries>
      </ListControl>
    </View>
  </ViewDefinitions>
</Configuration>