Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

MartinSGill/PSColorText

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PSColorText

ARCHIVED: Using $PSStyle instead.

What is it?

A module that allows you to define the colour of your text as part of your output string. Saving you from multiple calls to Write-Host to build up a single line of text.

Background

Everyone loves coloured text, it makes reading things easier, highlights important information and impresses your users (hopefully).

I found writing coloured text in PowerShell to be tedious. Certainly once you get past the phase of having a single line of colour and want to start having coloured elements in your lines.

I wrote this module to scratch that itch.

Usage

Basic Usage

Syntax

The module uses the token !(fg,bg) to indicate color changes in a string. Where fg is the foreground colour and bg is the background colour.

The colors are limited to the [ConsoleColor] type.

It supports a number of permutations.

Example Output Notes
An !(red,blue)example Basic usage, specify foreground and background
An !(cyan)example Specify just foreground
An !(,red)example Specify just background
A !(black,yellow)new(!*,*) example Reset to initial colors
!(red)* !(yellow)* !(green)* Change colour as often as you need

About

A PowerShell module that allows you to define the colour of your text as part of your output string.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published