Makes your console output finally look good
Install-Module PSColorizer
using module PSColorizer
# OR
Import-Module PSColorizer
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>
You can use any string which can be converted to the type System.ConsoleColor
. Wrong color name will throw an error:
Since module uses single regular expression to extract color tags, without any sort of actual parsing, nested color tags are not supported:
In that case, desired behaviour can be achieved by using tags in sequence:
You can specify default color which will be used outside of color tags: