plugins/ezout/formats/FilesAndDirectories.format.ps1xml

<?xml version="1.0" encoding="utf-16"?>
<Configuration>
  <ViewDefinitions>
    <View>
      <Name>System.IO.DirectoryInfoSystem.IO.FileInfo</Name>
      <ViewSelectedBy>
        <TypeName>System.IO.DirectoryInfo</TypeName>
        <TypeName>System.IO.FileInfo</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <AutoSize />
        <TableHeaders>
          <TableColumnHeader>
            <Label>Mode</Label>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>LastWriteTime</Label>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Length</Label>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Name</Label>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <ScriptBlock>
            $_.Mode
        </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
            [String]::Format("{0,10} {1,8}", $_.LastWriteTime.ToString("d"), $_.LastWriteTime.ToString("t"))
        </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
            if ($_ -is [System.IO.FileInfo]) {
                $_.Length
            }
        </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
            $name = $_.Name
            if ($OMPPansiesModuleLoaded -and ($null -ne (get-variable OMPEZOutDefinitions)) -and $Global:OMPConsoleHasANSI -and $Global:OMPEzOutPluginLoaded) {
                $revertcolor = New-Text -Object "" -ForegroundColor ((Get-OMPHostState).foreground) -ErrorAction:SilentlyContinue
                $IgnoreCase = [System.Text.RegularExpressions.RegexOptions]::IgnoreCase

                if ($_ -is [System.IO.DirectoryInfo]) {
                    $nameout = New-Text -Foregroundcolor $Global:OMPEZOutDefinitions['File'].DefaultDirectoryForeground -Object $name
                }
                else {
                    $nameout = New-Text -Foregroundcolor $Global:OMPEZOutDefinitions['File'].DefaultFileForeground -Object $name
                }

                Foreach ($P in ($Global:OMPEZOutDefinitions['File'].Patterns).keys) {
                    if (([regex]::new($Global:OMPEZOutDefinitions['File'].Patterns[$P].Pattern, $IgnoreCase)).IsMatch($name)) {
                        $nameout.foregroundcolor = $Global:OMPEZOutDefinitions['File'].Patterns[$P].Color
                        break
                    }
                }

                [string]$finaloutput = $nameout.ToString() + $revertcolor.ToString()# + "$([char](27))[0m"

                $finaloutput
            }
            else {
                $name
            }
        </ScriptBlock>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
  </ViewDefinitions>
</Configuration>