Skip to content

PowerShell module for color formatting of console output.

License

Notifications You must be signed in to change notification settings

2chevskii/PSColorizer

Repository files navigation

PSColorizer

Logo

Makes your console output finally look good

Installation

Install-Module PSColorizer

Usage

Import module

using module PSColorizer
# OR
Import-Module PSColorizer

Write into console

Write-Colorized is the comandlet exported from this module. It outputs messages using Console.WriteLine method, using certain grammar to format these messages.

Colors are set using the <color>message</color> notation.

Let's imagine you want message to appear violet in user's console:

<magenta>Hello world!</magenta>

readme-example-1

You can use any string which can be converted to the type System.ConsoleColor. Wrong color name will throw an error:

readme-example-2

Since module uses single regular expression to extract color tags, without any sort of actual parsing, nested color tags are not supported:

readme-example-3

In that case, desired behaviour can be achieved by using tags in sequence:

readme-example-3.1

You can specify default color which will be used outside of color tags:

readme-example-4

About

PowerShell module for color formatting of console output.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published