All Projects → joonro → Get Childitemcolor

joonro / Get Childitemcolor

Licence: mit
Add coloring to the output of Get-ChildItem Cmdlet of PowerShell.

Programming Languages

powershell
5483 projects

Labels

Projects that are alternatives of or similar to Get Childitemcolor

Nord Terminal App
An arctic, north-bluish clean and elegant Terminal.app color theme.
Stars: ✭ 198 (-21.12%)
Mutual labels:  color
Dynamic Support
A complete library to build Android apps with a built-in theme engine.
Stars: ✭ 218 (-13.15%)
Mutual labels:  color
Spectra
A Javascript color library. Quickly manipulate and convert colors.
Stars: ✭ 235 (-6.37%)
Mutual labels:  color
Efcolorpicker
A lightweight color picker in Swift.
Stars: ✭ 205 (-18.33%)
Mutual labels:  color
Xcolor
Lightweight color picker for X11
Stars: ✭ 209 (-16.73%)
Mutual labels:  color
Php Console Spinner
Colorful highly configurable spinner for php cli applications (suitable for async apps)
Stars: ✭ 225 (-10.36%)
Mutual labels:  color
Chartjs Plugin Colorschemes
Predefined color schemes for Chart.js
Stars: ✭ 189 (-24.7%)
Mutual labels:  color
Colorseekbar
A colorful SeekBar for picking color
Stars: ✭ 249 (-0.8%)
Mutual labels:  color
Rainbow
🌈 Colorize commands output or STDIN using patterns.
Stars: ✭ 217 (-13.55%)
Mutual labels:  color
Color Space
Math & data behind color spaces and color conversions.
Stars: ✭ 232 (-7.57%)
Mutual labels:  color
Uigradient
A simple and powerful library for using gradient layer, image, color
Stars: ✭ 208 (-17.13%)
Mutual labels:  color
Contrast Swatch
🅰️ Image microservice for color contrast information
Stars: ✭ 210 (-16.33%)
Mutual labels:  color
Dynamiccolor
Yet another extension to manipulate colors easily in Swift and SwiftUI
Stars: ✭ 2,677 (+966.53%)
Mutual labels:  color
Flutter statusbarcolor
A package can help you to change your flutter app's statusbar's color or navigationbar's color programmatically.
Stars: ✭ 203 (-19.12%)
Mutual labels:  color
Django Colorfield
color field for django models with a nice color-picker in the admin. 🎨
Stars: ✭ 238 (-5.18%)
Mutual labels:  color
Prettyprint
Beautifully formatted output for your terminal 🌈
Stars: ✭ 195 (-22.31%)
Mutual labels:  color
Androidphotoshopcolorpicker
A fully featured Color picker Library for Android
Stars: ✭ 220 (-12.35%)
Mutual labels:  color
Hexbot
Every request returns a different hex code—all 16,777,216 of them.
Stars: ✭ 251 (+0%)
Mutual labels:  color
Nord Alacritty
An arctic, north-bluish clean and elegant Alacritty color scheme.
Stars: ✭ 238 (-5.18%)
Mutual labels:  color
Sketch
Sketch have a lot of basic functions to develop a drawing app for iPhone. Anyone can easily create drawing iOS Application.
Stars: ✭ 229 (-8.76%)
Mutual labels:  color

Created 2019-07-20 Sat 10:30

#+TITLE: Get-ChildItemColor #+AUTHOR: Joon Ro

=Get-ChildItemColor= provides colorization of outputs of Get-ChildItem Cmdlet of PowerShell. It is based on Tim Johnson's [[http://tasteofpowershell.blogspot.com/2009/02/get-childitem-dir-results-color-coded.html][script,]] another [[http://mow001.blogspot.com/2006/01/colorized-msh-ls-replacement.html][script]] by [[http://thepowershellguy.com/][the PowerShell Guy]], and [[https://github.com/Davlind/PSColor][PSColor]].

It provides two main functionalities:

  1. Directly provide coloring outputs of Get-ChildItem by modifying Out-Default. Once the module is imported, Get-ChildItem's output will be automatically colored. It does support pipeline (e.g., Get-ChildItem | grep ".git"). Also, now the directory name and the headers of its output have consistent colors. This is an adaptation of [[https://github.com/Davlind/PSColor][PSColor]].
  2. It provides =Get-ChildItemColorFormatWide=, which uses =Write-Host= to output coloring. This is because =Get-ChildItemColor | Format-Wide= does not allow multiple colors in one line. As a result, pipeline does not work with =Get-ChildItemColorFormatWide=.

It also provides Get-ChildItemColor, which just changes =$Host.UI.RawUI.ForegroundColor= and keep the item object intact. This was the implementation before v2.0.0, and it does support pipeline. (e.g., Get-ChildItemColor | grep ".git"). The main shortcoming of this approach is that the directory name and the headers of its output have inconsistent colors.

  • Screenshot: ** Get-ChildItem (Colorized) [[file:./screenshots/Get-ChildItem.png]] ** Get-ChildItemColorFormatWide (=ls= equivalent) [[file:./screenshots/Get-ChildItemColorFormatWide.png]] ** Get-ChildItemColor [[file:./screenshots/Get-ChildItemColor.png]]
  • Install ** Install from [[https://www.powershellgallery.com/packages/Get-ChildItemColor/][PowerShellGallery]] PowerShellGet is required, which is included in Windows 10 and WMF5. If you are using PowerShell V3 or V4, you will need to install [[https://www.microsoft.com/en-us/download/details.aspx?id=49186][PowerShellGet]].

Then, you can run =Install-Module -AllowClobber Get-ChildItemColor=. Note that you need =-AllowClobber= option so =Get-ChildItemColor= may override the existing command =Out-Default=. ** Install from GitHub After cloning the repo, you can put files in =/src= folder into =Get-ChildItemColor= folder under your =PSModulePath= (e.g., =$ENV:UserProfile\Documents\PowerShell\Modules= for PowerShell 6 and later). The =master= branch always contains the latest release version. ** Install from [[https://chocolatey.org][Chocolatey]] The module is available as a [[https://chocolatey.org/packages/get-childitemcolor][Chocolatey package]]. Install it using =choco install get-childitemcolor=.

  • Usage When you import the module:

#+begin_src powershell Import-Module Get-ChildItemColor #+end_src

it provides a proxy function for =Output-Default=, so =Get-ChildItem='s output will be automatically colored. In addition, it provides two functions, =Get-ChildItemColorFormatWide= and =Get-ChildItemColor= (the latter is unlikely to be useful, but remained intact just in case).

You can add aliases to these functions for convenience. For example, I have the following in my profile[fn:pathProfile] (please do not put this into ISE profile[fn:pathProfileISE] as it does not work in ISE):

#+begin_src powershell If (-Not (Test-Path Variable:PSise)) { # Only run this in the console and not in the ISE Import-Module Get-ChildItemColor

Set-Alias l Get-ChildItem -option AllScope
Set-Alias ls Get-ChildItemColorFormatWide -option AllScope

} #+end_src

So =l= yields colored output of =Get-ChildItem= and =ls= yields colored output of =Get-ChildItem | Format-Wide= equivalent.

[fn:pathProfile] $Home[My ]Documents\WindowsPowerShell\Profile.ps1

[fn:pathProfileISE] $Home[My ]Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1

** Customizing color One can dynamically change the color scheme for different items, thanks to [[https://github.com/asidlo][asidlo]]'s [[https://github.com/joonro/Get-ChildItemColor/pull/23][contribution]]. See the example below.

#+begin_src powershell

Change color for directories to Blue

$GetChildItemColorTable.File['Directory'] = "Blue"

Change color for executables to Green

ForEach ($Exe in $GetChildItemColorExtensions.ExecutableList) { $GetChildItemColorTable.File[$Exe] = "Green" } #+end_src ** Customizing vertical space You can adjust the vertical spacing using =$Global:GetChildItemColorVerticalSpace=. Default is 1 (PowerShell's default is 2).

#+begin_src powershell $Global:GetChildItemColorVerticalSpace = 1 #+end_src

  • Authors
  • [[http://github.com/joonro][Joon Ro]].
  • Changelog ** v2.2.0
  • Fix #27, Display issue with Chinese. (Thanks to [[https://github.com/shiena][shiena]]) ** v2.1.1
  • BUGFIX: Print directory names correctly when =-Recurse= option is used ** v2.1.0
  • Re-organize folder structure ** v2.0.0
  • Incorporate [[https://github.com/Davlind/PSColor][PSColor]]'s implementation of coloring the output of =Get-ChildItem=.
  • Add =$Global:GetChildItemColorVerticalSpace= option. ** v1.3.1
  • PR #21: Added ReparsePoint (symlink) detection, matched color scheme with Linux (thanks to [[https://github.com/cmilanf][cmilanf]])
  • Make empty lines consistent between Get-ChildItemColor and Get-ChildItemColorFormatWide (Fixes [[https://github.com/joonro/Get-ChildItemColor/issues/17][#17]]) ** v1.3.0
  • PR [[https://github.com/joonro/Get-ChildItemColor/pull/23][#23]]: Added customizable color output. (thanks to [[https://github.com/asidlo][asidlo]])
  • Improve README ** v1.2.3
  • Add LICENSE ** v1.2.2
  • Improve README (#15)
  • Beautify code ** v1.2.1
  • PR #13: Fallback to Gray when no =OriginalForegroundColor= (thanks to [[https://github.com/joonro/Get-ChildItemColor/issues?q=is%3Apr+author%3Amikesigs][mikesigs]])
  • PR #12: Fix a typo (thanks to [[https://github.com/joonro/Get-ChildItemColor/issues?q=is%3Apr+author%3Ajqly][jqly]]) ** v1.2.0
  • Robust to non-file entries (Issue #10) ** v1.1.0
  • Revert back to previous implementation of =Get-ChildItemColorFormatWide= ** v1.0.0
  • The script changes =$Host.UI.RawUI.ForegroundColor= only and keep the item object intact
  • =Get-ChildItemColorFormatWide= is basically =Get-ChildItemColor | Format-Wide= ** v0.5.3
  • Better performance by reducing if's
  • Proper printing of =DirectoryEntry= for =FormatWide= case ** v0.5.2
  • Published on PowerShellGallery
  • Refactoring; separate out two functions ** v0.4.2
  • Make it a PowerShell module ** v0.4.1
  • Returns vanila =Get-Childitem= results for =DictionaryEntry= cases. ** v0.4.0
  • Make function names consistent to the PowerShell naming convention (#8)
  • Use parameters more consistently, =-Path= works with paths with spaces (#3), and =-Force= works (#9)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].