Skip to content

Commit

Permalink
[powershell] Tweak/enhance custom ll (ls) function
Browse files Browse the repository at this point in the history
I really need to just use Format.ps1xml. I will, eventually, but this is
well more than good enough for now.

docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_format.ps1xml
docs.microsoft.com/powershell/scripting/developer/format/writing-a-powershell-formatting-file
  • Loading branch information
atimholt committed Nov 23, 2020
1 parent f79bfd4 commit 1937c57
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Powershellrc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -253,19 +253,23 @@
If ($Return) {$Bytes.ToString()}
}

function ll
function ll()
{
gci $args `
| Format-Table -AutoSize `
Mode, `
| Format-Table `
-AutoSize `
@{ `
Name='LastWriteTime'; `
Name='Mode '; `
Expression={$_.Mode} `
}, `
@{ `
Name='Last Write Time '; `
Expression={ `
$_.LastWriteTime.ToString('yyyy-MM-dd HH:mm') `
} `
}, `
@{ `
Name='Size'; `
Name='Size '; `
Expression={ `
Format-ByteSize($_.Length) `
} `
Expand Down

0 comments on commit 1937c57

Please sign in to comment.