formats/PSBlueskySession.format.ps1xml
<!--
Format type data generated 11/01/2024 10:19:08 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 11/01/2024 10:19:08 by PROSPERO\Jeff--> <Name>default</Name> <ViewSelectedBy> <TypeName>PSBlueskySession</TypeName> </ViewSelectedBy> <GroupBy> <!-- You can also use a scriptblock to define a custom property name. You must have a Label tag. <ScriptBlock>$_.machinename.ToUpper()</ScriptBlock> <Label>Computername</Label> Use <Label> to set the displayed value. --> <ScriptBlock> if ($_.Active) { $fg = $PSStyle.Foreground.BrightGreen } else { $fg = $PSStyle.Foreground.Red } "{0}{1}{2}" -f $fg,$_.Username,$PSStyle.Reset </ScriptBlock> <Label>User</Label> </GroupBy> <TableControl> <!--Delete the AutoSize node if you want to use the defined widths.--> <AutoSize /> <TableHeaders> <TableColumnHeader> <Label>Active</Label> <Width>10</Width> <Alignment>left</Alignment> </TableColumnHeader> <TableColumnHeader> <Label>AccessToken</Label> <Width>25</Width> <Alignment>left</Alignment> </TableColumnHeader> <TableColumnHeader> <Label>RefreshToken</Label> <Width>25</Width> <Alignment>left</Alignment> </TableColumnHeader> <TableColumnHeader> <Label>Age</Label> <Width>19</Width> <Alignment>left</Alignment> </TableColumnHeader> </TableHeaders> <TableRowEntries> <TableRowEntry> <Wrap /> <TableColumnItems> <TableColumnItem> <PropertyName>Active</PropertyName> </TableColumnItem> <TableColumnItem> <ScriptBlock> "{0}..." -f $_.AccessToken.Substring(0,20) </ScriptBlock> </TableColumnItem> <TableColumnItem> <ScriptBlock> "{0}..." -f $_.RefreshToken.Substring(0,20) </ScriptBlock> </TableColumnItem> <TableColumnItem> <PropertyName>Age</PropertyName> </TableColumnItem> </TableColumnItems> </TableRowEntry> </TableRowEntries> </TableControl> </View> </ViewDefinitions> </Configuration> |