formats/PSBlueskyFollower.format.ps1xml

<!--
Format type data generated 10/27/2024 09:49:13 by THINKX1-JH\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 10/27/2024 09:49:13 by THINKX1-JH\Jeff-->
      <Name>followers</Name>
      <ViewSelectedBy>
        <TypeName>PSBlueskyFollowProfile</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <!--Delete the AutoSize node if you want to use the defined widths.-->
        <AutoSize />
        <TableHeaders>
          <TableColumnHeader>
            <Label>Display</Label>
            <Width>14</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Username</Label>
            <Width>21</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Description</Label>
            <Width>113</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Display</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
                  "{0}{1}{2}" -f ($bskyPreferences.Username),($PSStyle.formatHyperlink($_.Username,$_.url)),$PSStyle.Reset
                </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Description</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>default</Name>
      <ViewSelectedBy>
        <TypeName>PSBlueskyFollowProfile</TypeName>
      </ViewSelectedBy>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <ExpressionBinding>
                <ScriptBlock>
                  <!--
                  18 Feb 2025 Added optional code to use pwshSpectreConsole module
                  to display the user's avatar. This will only work if the module
                  is installed and the console properly configured.
                  -->
                Try {
                    $avt = (Get-SpectreImage $_.avatar -MaxWidth 5 -errorAction Stop | Out-SpectreHost).Trim()
                }
                Catch {
                    $avt = $Null
                }
                "{2} {0} [$($bskyPreferences['UserName']){1}$($PSStyle.Reset)]" -f $_.Display.trim(),$($PSStyle.FormatHyperLink($_.UserName,$_.Url)),$avt
              </ScriptBlock>
              </ExpressionBinding>
              <NewLine/>
              <NewLine/>
              <ExpressionBinding>
                <ScriptBlock>
                     "{0}{1}{2}" -f ($bskyPreferences['ProfileDescription']),($_.Description.split("`n").foreach({$_.ToString()})|Out-String),$PSStyle.Reset
                </ScriptBlock>
              </ExpressionBinding>
              <NewLine/>
              <ExpressionBinding>
                <ScriptBlock>
                  "Created: {0:g}" -f $_.Created
                </ScriptBlock>
              </ExpressionBinding>
              <NewLine/>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </View>
  </ViewDefinitions>
</Configuration>