Chapters/adding-custom-formatting/Solution/TMMachineInfo/tmmachineinfo.format.ps1xml

<?xml version="1.0" encoding="UTF-8"?>
<!--
format type data generated 06/23/2020 10:47:52 by BOVINE320\Jeff
-->
<Configuration>
  <ViewDefinitions>
    <View>
      <!--Created 06/23/2020 10:47:52 by BOVINE320\Jeff-->
      <Name>default</Name>
      <ViewSelectedBy>
        <TypeName>TMMachineInfo</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <!--Delete the AutoSize node if you want to use the defined widths.
        <AutoSize /> -->
        <TableHeaders>
          <TableColumnHeader>
            <Label>ComputerName</Label>
            <Width>15</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>OSVersion</Label>
            <Width>13</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Manufacturer</Label>
            <Width>15</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>MemGB</Label>
            <Width>5</Width>
            <Alignment>right</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>ComputerName</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>OSVersion</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Manufacturer</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>$_.RAM -as [int]</ScriptBlock>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <!--Created 06/23/2020 10:50:32 by BOVINE320\Jeff-->
      <Name>hardware</Name>
      <ViewSelectedBy>
        <TypeName>TMMachineInfo</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <!--Delete the AutoSize node if you want to use the defined widths.
        <AutoSize />-->
        <TableHeaders>
          <TableColumnHeader>
            <Label>ComputerName</Label>
            <Width>15</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Manufacturer</Label>
            <Width>20</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Model</Label>
            <Width>20</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>CPUs</Label>
            <Width>5</Width>
            <Alignment>right</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Cores</Label>
            <Width>6</Width>
            <Alignment>right</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>MemGB</Label>
            <Width>5</Width>
            <Alignment>right</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>SysFreeGB</Label>
            <Width>10</Width>
            <Alignment>right</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>ComputerName</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Manufacturer</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Model</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Processors</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Cores</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>$_.RAM -as [int]</ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>[math]::Round($_.SystemFreeSpace/1GB,4)</ScriptBlock>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
  </ViewDefinitions>
</Configuration>