FileInfo.format.ps1xml
<Configuration>
<SelectionSets> <SelectionSet> <Name>FileSystemTypes</Name> <Types> <TypeName>System.IO.DirectoryInfo</TypeName> <TypeName>System.IO.FileInfo</TypeName> </Types> </SelectionSet> </SelectionSets> <!-- ################ GLOBAL CONTROL DEFINITIONS ################ --> <Controls> <Control> <Name>FileSystemTypes-GroupingFormat</Name> <CustomControl> <CustomEntries> <CustomEntry> <CustomItem> <Frame> <LeftIndent>4</LeftIndent> <CustomItem> <Text AssemblyName="System.Management.Automation" BaseName="FileSystemProviderStrings" ResourceId="DirectoryDisplayGrouping"/> <ExpressionBinding> <ScriptBlock> $_.PSParentPath.Replace("Microsoft.PowerShell.Core\FileSystem::", "") </ScriptBlock> </ExpressionBinding> <NewLine/> </CustomItem> </Frame> </CustomItem> </CustomEntry> </CustomEntries> </CustomControl> </Control> </Controls> <!-- ################ VIEW DEFINITIONS ################ --> <ViewDefinitions> <View> <Name>children</Name> <ViewSelectedBy> <SelectionSetName>FileSystemTypes</SelectionSetName> </ViewSelectedBy> <GroupBy> <PropertyName>PSParentPath</PropertyName> <CustomControlName>FileSystemTypes-GroupingFormat</CustomControlName> </GroupBy> <TableControl> <TableHeaders> <TableColumnHeader> <Label>Mode</Label> <Width>8</Width> <Alignment>left</Alignment> </TableColumnHeader> <TableColumnHeader> <Label>LastWritten</Label> <Width>15</Width> </TableColumnHeader> <TableColumnHeader> <Label>Length</Label> <Width>10</Width> <Alignment>right</Alignment> </TableColumnHeader> <TableColumnHeader/> </TableHeaders> <TableRowEntries> <TableRowEntry> <Wrap/> <TableColumnItems> <TableColumnItem> <PropertyName>Mode</PropertyName> </TableColumnItem> <TableColumnItem> <ScriptBlock> [Humanizer.DateHumanizeExtensions]::Humanize($_.LastWriteTime,$false) </ScriptBlock> </TableColumnItem> <TableColumnItem> <ScriptBlock> if (-not $_.PSIsContainer) { [Humanizer.ByteSizeExtensions]::bytes($_.Length).ToString(0.00)} </ScriptBlock> </TableColumnItem> <TableColumnItem> <PropertyName>Name</PropertyName> </TableColumnItem> </TableColumnItems> </TableRowEntry> </TableRowEntries> </TableControl> </View> </ViewDefinitions> </Configuration> |