GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Davlind/PSColor: Provides simple color highlighting for some PowerShell output

This repository was archived by the owner on Jun 26, 2023. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

16 Commits
16 Commits

Folders and files

NameName
Last commit message
Last commit date
release
release
 
 
src
src
 
 
tools
tools
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

PSColor

Provides color highlighting for some basic PowerShell output. It currently rewrites "Out-Default" to colorize:

  • FileInfo & DirectoryInfo objects (Get-ChildItem, dir, ls etc.)
  • ServiceController objects (Get-Service)
  • MatchInfo objects (Select-String etc.)

Installation

The easiest way to install, by far, is to use PsGet. Once PsGet is installed you can simply run Install-Module PSColor.

Alternativly, you can download the file PSColor.zip and extract it to a folder named PSColor in any of your PowerShell module paths. (Run $env:PSModulePath to see your paths.)

If you want PSColor to be ran automatically you can add Import-Module PSColor to your PowerShell Profile. To locate your profile, run $profile

Configuration

You can configure PSColor by overriding the values of colors, patterns etc. Configurations should be added after Import-Module PSColor in your PowerShell profile. The default configuration looks like:

$global:PSColor = @{
    File = @{
        Default    = @{ Color = 'White' }
        Directory  = @{ Color = 'Cyan'}
        Hidden     = @{ Color = 'DarkGray'; Pattern = '^\.' } 
        Code       = @{ Color = 'Magenta'; Pattern = '\.(java|c|cpp|cs|js|css|html)$' }
        Executable = @{ Color = 'Red'; Pattern = '\.(exe|bat|cmd|py|pl|ps1|psm1|vbs|rb|reg)$' }
        Text       = @{ Color = 'Yellow'; Pattern = '\.(txt|cfg|conf|ini|csv|log|config|xml|yml|md|markdown)$' }
        Compressed = @{ Color = 'Green'; Pattern = '\.(zip|tar|gz|rar|jar|war)$' }
    }
    Service = @{
        Default = @{ Color = 'White' }
        Running = @{ Color = 'DarkGreen' }
        Stopped = @{ Color = 'DarkRed' }     
    }
    Match = @{
        Default    = @{ Color = 'White' }
        Path       = @{ Color = 'Cyan'}
        LineNumber = @{ Color = 'Yellow' }
        Line       = @{ Color = 'White' }
    }
	NoMatch = @{
        Default    = @{ Color = 'White' }
        Path       = @{ Color = 'Cyan'}
        LineNumber = @{ Color = 'Yellow' }
        Line       = @{ Color = 'White' }
    }
}

E.g. if you would like to override the red color for Executables, in favour of blue; you could add the following to your PowerShell profile:

$global:PSColor.File.Executable.Color = 'Blue'

About

Provides simple color highlighting for some PowerShell output

Resources

Readme
MIT license
Activity

Stars

175 stars

Watchers

2 watching

Forks

28 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.