PSWriteColorEX

1.2.0

Colored and styled console output for PowerShell: TrueColor (24-bit RGB), ANSI 256 and 16 colors, gradients, markup, highlighting, links, text styles, style profiles, padding and wrapping that count wide characters, and logging to a file. Pure PowerShell, for Windows PowerShell 5.1 and PowerShell 7 on Windows, Linux and macOS.

Minimum PowerShell version

5.1

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name PSWriteColorEX

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name PSWriteColorEX

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2026 Mark Newton

Package Details

Author(s)

  • Mark Newton

Tags

Console Color Colour ANSI Terminal Output Formatting Logging TrueColor RGB CrossPlatform Windows Linux macOS

Functions

Write-ColorEX Write-ColorError Write-ColorWarning Write-ColorInfo Write-ColorSuccess Write-ColorCritical Write-ColorDebug Set-ColorDefault Get-ColorProfiles New-ColorStyle Test-AnsiSupport Convert-HexToRGB Convert-RGBToANSI8 Convert-RGBToANSI4 Get-ColorTableWithRGB Measure-DisplayWidth Get-LighterRGBColor Get-LighterColorName Get-LighterANSI8Color Format-ColorEX Show-ColorTable Register-ColorName Unregister-ColorName Export-ColorProfile Import-ColorProfile Remove-ColorProfile

PSEditions

Desktop Core

Dependencies

This module has no dependencies.

Release Notes

1.2.0

Added:
- Write-ColorEX -Markup: tags that color and style part of a string, such as '[bold red]Error:[/] file not found'.
- -Split, -SplitAround and -SplitEvenly color parts of a string without giving it in pieces.
- -Highlight colors and styles the text regular expressions match.
- -Link writes links that terminals open when clicked.
- -Reverse, -UnderlineStyle (single, double, curly, dotted, dashed) and -UnderlineColor.
- -BackGroundGradient, and -GradientSpace OKLab or RGB.
- -Truncate, -PadCenter and -Wrap.
- Colors in the forms #RGB, rgb(r, g, b) and hsl(h, s%, l%).
- Format-ColorEX answers colored text as strings; Show-ColorTable shows every color name.
- Register-ColorName and Unregister-ColorName; Export-ColorProfile, Import-ColorProfile and Remove-ColorProfile.
- Tab completion of color and profile names.
- Detection of Ghostty, WezTerm, Warp, Kitty, Alacritty, foot, JetBrains IDEs and tmux; CLICOLOR_FORCE and CLICOLOR.

Changed:
- Gradients blend in OKLab; -GradientSpace RGB gives the 1.1.0 colors.
- An unknown color name gives a warning and no color.
- -Gradient writes -BackGroundColor under the gradient.
- Write-ColorEX takes 38% to 60% less time per call than 1.1.0.
- FORCE_COLOR and CLICOLOR_FORCE write a line of color names as escape codes in every host, so the colors reach a CI log.

Fixed:
- -Color and -BackGroundColor take $null entries.
- Set-ColorDefault with no parameters makes the default style plain Gray.
- With -ANSI8 or -ANSI4, a hex, rgb() or hsl() color is written as the nearest color of that mode.
- PowerShell 7 in the Windows console host lightens -Bold colors, as Windows PowerShell 5.1 does there.

The full list is in CHANGELOG.md: https://github.com/MarkusMcNugen/PSWriteColorEX/blob/main/CHANGELOG.md

FileList

Version History

Version Downloads Last updated
1.2.0 (current version) 5 10/9/2026
1.1.0 9 10/6/2026