TerminalBlocks.format.ps1xml
<Configuration>
<SelectionSets> <SelectionSet> <Name>Prompt</Name> <Types> <TypeName>PoshCode.TerminalBlock[]</TypeName> <TypeName>System.Collections.Generic.List`1[PoshCode.TerminalBlock]</TypeName> </Types> </SelectionSet> </SelectionSets> <DefaultSettings> <EnumerableExpansions> <EnumerableExpansion> <EntrySelectedBy> <SelectionSetName>Prompt</SelectionSetName> </EntrySelectedBy> <Expand>CoreOnly</Expand> </EnumerableExpansion> </EnumerableExpansions> </DefaultSettings> <ViewDefinitions> <View> <Name>TerminalBlock</Name> <ViewSelectedBy> <TypeName>PoshCode.TerminalBlock</TypeName> </ViewSelectedBy> <TableControl> <TableHeaders> <TableColumnHeader> <Width>10</Width> <Label>Background</Label> </TableColumnHeader> <TableColumnHeader> <Width>10</Width> <Label>Foreground</Label> </TableColumnHeader> <TableColumnHeader> <Width>9</Width> <Label>Alignment</Label> </TableColumnHeader> <TableColumnHeader> <Width>8</Width> <Label>Position</Label> </TableColumnHeader> <TableColumnHeader> <Label>Content</Label> </TableColumnHeader> <TableColumnHeader> <Label>ToString</Label> </TableColumnHeader> </TableHeaders> <TableRowEntries> <TableRowEntry> <TableColumnItems> <TableColumnItem> <ScriptBlock> $_.BackgroundColor.ToVtEscapeSequence($true) + " $([char]27)[0m " + $_.BackgroundColor.ToString() </ScriptBlock> </TableColumnItem> <TableColumnItem> <ScriptBlock> $_.ForegroundColor.ToVtEscapeSequence($true) + " $([char]27)[0m " + $_.ForegroundColor.ToString() </ScriptBlock> </TableColumnItem> <TableColumnItem> <PropertyName>Alignment</PropertyName> </TableColumnItem> <TableColumnItem> <ScriptBlock> if ($_.Position) { $_.Position.ToPSMetadata() } </ScriptBlock> </TableColumnItem> <TableColumnItem> <ScriptBlock> ("$(if ($_.Content -is [ScriptBlock]) { "{{ {0} }}" } else { "{0}" })" -f ([System.Management.Automation.LanguagePrimitives]::ConvertTo($_.Content, [string]).Trim())) + "$([char]27)[0m" </ScriptBlock> </TableColumnItem> <TableColumnItem> <ScriptBlock> $_.ToString($false) + "$([char]27)[0m" </ScriptBlock> </TableColumnItem> </TableColumnItems> </TableRowEntry> </TableRowEntries> </TableControl> </View> <View> <Name>Prompt</Name> <ViewSelectedBy> <SelectionSetName>Prompt</SelectionSetName> </ViewSelectedBy> <CustomControl> <CustomEntries> <CustomEntry> <CustomItem> <ExpressionBinding> <ScriptBlock> "$(Write-TerminalBlock $_)" </ScriptBlock> </ExpressionBinding> </CustomItem> </CustomEntry> </CustomEntries> </CustomControl> </View> </ViewDefinitions> </Configuration> |