Add coloring to the output of Get-ChildItem Cmdlet of PowerShell. In
addition to the original functionality, this provides:
- Better performance by using
Dictionaryobjects instead of regular expressions - Color support for
Format-Widecase (lsequivalent) - Automatically compute number of columns for
Format-Widecase (thanks to Guillaume Collic)
git clone https://github.com/joonro/Get-ChildItem-Color.gitIt is convenient to do this in your $PROFILE [1] folder.
In your $PROFILE, add the following:
. "Path\To\Get-ChildItem-Color\Get-ChildItem-Color.ps1"
Set-Alias l Get-ChildItem-Color -option AllScope
Set-Alias ls Get-ChildItem-Format-Wide -option AllScopeIf you install it under the $PROFILE folder, you can also do the following:
$ScriptPath = Split-Path -parent $PSCommandPath
. "$ScriptPath\Get-ChildItem-Color\Get-ChildItem-Color.ps1"
Set-Alias l Get-ChildItem-Color -option AllScope
Set-Alias ls Get-ChildItem-Format-Wide -option AllScopeThis code is based on Tim Johnson's script and also Keith Hill's answer at this Stack Overflow question.
| [1] | C:\Users\username\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 |