@@ -8,22 +8,16 @@ by [[http://thepowershellguy.com/][the PowerShell Guy]], and [[https://github.co
88
99It provides two main functionalities:
1010
11- 1. Directly provide coloring of ~Get-ChildItem~ output by modifying
12- ~Out-Default~. Once the module is imported, ~Get-ChildItem~'s output will
13- be automatically colored. It does support pipeline (e.g., ~Get-ChildItem |
14- grep ".git"~). Also, now the directory name and the headers of its output
15- have consistent colors. This is an adaptation of [[https://github.com/Davlind/PSColor][PSColor]].
11+ 1. Provide ~Get-ChildItemColor~, which adds coloring to the output of
12+ ~Get-ChildItem~, this function supports pipelines (it is pipeline-aware, so
13+ it does not touch the output when it is being used in a pipeline).
16142. It provides =Get-ChildItemColorFormatWide=, which uses =Write-Host= to
1715 output coloring. This is because =Get-ChildItemColor | Format-Wide= does
18- not allow multiple colors in one line. As a result, pipeline does not work with
19- =Get-ChildItemColorFormatWide=.
16+ not allow multiple colors in one line. As a result, pipeline does not work
17+ with =Get-ChildItemColorFormatWide=.
2018
21- It also provides ~Get-ChildItemColor~, which just changes
22- =$Host.UI.RawUI.ForegroundColor= and keep the item object intact. This was the
23- implementation before v2.0.0, and it does support pipeline. (e.g.,
24- ~Get-ChildItemColor | grep ".git"~). The main shortcoming of this approach is
25- that the directory name and the headers of its output have inconsistent
26- colors.
19+ Note that as of v3.0.0, it no longer overloads ~Out-Default~, and thus ~Get-ChildItem~'s
20+ output will not be touched. Users should use ~Get-ChildItemColor~ instead.
2721
2822* Screenshot:
2923** Get-ChildItem (Colorized)
@@ -54,10 +48,8 @@ When you import the module:
5448Import-Module Get-ChildItemColor
5549#+end_src
5650
57- it provides a proxy function for =Output-Default=, so =Get-ChildItem='s output
58- will be automatically colored. In addition, it provides two functions,
59- =Get-ChildItemColorFormatWide= and =Get-ChildItemColor= (the latter is
60- unlikely to be useful, but remained intact just in case).
51+ it provides two functions, =Get-ChildItemColorFormatWide= and
52+ =Get-ChildItemColor=.
6153
6254You can add aliases to these functions for convenience. For example, I have
6355the following in my profile[fn:pathProfile] (please do not put this into ISE
@@ -67,15 +59,18 @@ profile[fn:pathProfileISE] as it does not work in ISE):
6759If (-Not (Test-Path Variable:PSise)) { # Only run this in the console and not in the ISE
6860 Import-Module Get-ChildItemColor
6961
70- Set-Alias l Get-ChildItem -option AllScope
71- Set-Alias ls Get-ChildItemColorFormatWide -option AllScope [-HideHeader]
62+ Set-Alias l Get-ChildItemColor -option AllScope
63+ Set-Alias ls Get-ChildItemColorFormatWide -option AllScope [-HideHeader] [-TrailingSlashDirectory]
7264}
7365#+end_src
7466
7567So =l= yields colored output of =Get-ChildItem= and =ls= yields colored output
76- of =Get-ChildItem | Format-Wide= equivalent. There is an optional
77- ~-HideHeader~ switch which will supress printing of headers (path on top) for
78- ~Get-ChildItemColorFormatWide~ when specified.
68+ of =Get-ChildItem | Format-Wide= equivalent.
69+
70+ ~Get-ChildItemColorFormatWide~ has the following optional switches:
71+
72+ - -HideHeader :: supress printing of headers (path on top).
73+ - -TrailingSlashDirectory :: add a trailing slash to directory names.
7974
8075[fn:pathProfile] ~$Home\[My ]Documents\PowerShell\Profile.ps1~ or ~$Home\[My ]Documents\WindowsPowerShell\Profile.ps1~
8176
@@ -118,6 +113,10 @@ $Global:GetChildItemColorVerticalSpace = 1
118113* Authors
119114- [[http://github.com/joonro][Joon Ro]].
120115* Changelog
116+ ** v3.0.0
117+ - ~Get-ChildItemColor~ is pipeline-aware and only adds color when it is not
118+ being used as a part of a pipeline. It no longer overloads ~Out-Default~. ([[https://github.com/joonro/Get-ChildItemColor/issues/31][#31]])
119+ - Add ~TrailingSlashDirectory~ switch to ~Get-ChildItemColorFormatWide~ ([[https://github.com/joonro/Get-ChildItemColor/issues/37][#37]])
121120** v2.4.0
122121- Add ~HideHeader~ switch to ~Get-ChildItemColorFormatWide~ ([[https://github.com/joonro/Get-ChildItemColor/issues/29][#29]])
123122** v2.3.0
0 commit comments