formats/alias.format.ps1xml

<?xml version="1.0" encoding="UTF-8"?>
<!--
format type data generated 08/04/2020 15:58:47 by BOVINE320\Jeff
This is a custom formatting file to be used with alias objects
-->
<Configuration>
  <ViewDefinitions>
    <View>
      <!--Created 08/04/2020 15:58:47 by BOVINE320\Jeff-->
      <Name>options</Name>
      <ViewSelectedBy>
        <TypeName>System.Management.Automation.AliasInfo</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <!--Delete the AutoSize node if you want to use the defined widths.
        <AutoSize />-->
        <TableHeaders>
          <TableColumnHeader>
            <Label>Name</Label>
            <Width>15</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Definition</Label>
            <Width>24</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Options</Label>
            <Width>20</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>ModuleName</Label>
            <Width>30</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Version</Label>
            <Width>8</Width>
            <Alignment>right</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Definition</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
                  <!-- display ReadOnly option in Red if running in the console host-->
                  if ($host.name -match 'Console|Code|remotehost' -AND ($_.Options -match 'ReadOnly')) {
                    "$([char]27)[91m$($_.Options -join ',')$([char]27)[0m"
                  }
                  else {
                    $_.Options
                  }
                </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>ModuleName</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Version</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <!--Created 08/04/2020 16:02:11 by BOVINE320\Jeff-->
      <Name>source</Name>
      <ViewSelectedBy>
        <TypeName>System.Management.Automation.AliasInfo</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <ScriptBlock>"{0} {1}" -f $_.Source,$_.version</ScriptBlock>
        <Label>Source</Label>
      </GroupBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
            <Label>Name</Label>
            <Width>20</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Definition</Label>
            <Width>60</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Definition</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <!--Created 04/09/2021 08:34:30 by PROSPERO\Jeff-->
      <Name>simple</Name>
      <ViewSelectedBy>
        <TypeName>System.Management.Automation.AliasInfo</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <!--Delete the AutoSize node if you want to use the defined widths.-->
        <AutoSize />
        <TableHeaders>
          <TableColumnHeader>
            <Label>Name</Label>
            <Width>7</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>ResolvedCommandName</Label>
            <Width>22</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>ResolvedCommandName</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <!--Created 04/09/2021 08:39:54 by PROSPERO\Jeff-->
      <Name>simple</Name>
      <ViewSelectedBy>
        <TypeName>System.Management.Automation.AliasInfo</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <!--Delete the AutoSize node if you want to use the defined widths.-->
        <AutoSize />
        <TableHeaders>
          <TableColumnHeader>
            <Label>Name</Label>
            <Width>7</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>ResolvedCommandName</Label>
            <Width>22</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>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>ResolvedCommandName</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
  </ViewDefinitions>
</Configuration>