formats/wgversion.format.ps1xml

<!--
Format type data generated 01/24/2022 15:41:18 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 01/24/2022 15:41:18 by PROSPERO\Jeff-->
      <Name>default</Name>
      <ViewSelectedBy>
        <TypeName>WGVersion</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <!--Delete the AutoSize node if you want to use the defined widths.
        <AutoSize />-->
        <TableHeaders>
          <TableColumnHeader>
            <Label>Installed</Label>
            <Width>12</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Online</Label>
            <Width>12</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Update</Label>
            <Width>9</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Command</Label>
            <Width>63</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <!--
            By default the entries use property names, but you can replace them with scriptblocks.
            <ScriptBlock>$_.foo /1mb -as [int]</ScriptBlock>
-->
              <TableColumnItem>
                <PropertyName>Installed</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Online</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
                if ($host.name -match "console|vscode" -AND ($_.Update)) {
                  <!-- display in green-->
                  "$([char]27)[92m$($_.Update)$([char]27)[0m"
                }
                else {
                  $_.Update
                }
                </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Command</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
  </ViewDefinitions>
</Configuration>