PSWriteColorEX

1.2.1

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 Get-GradientColor Get-ColorContrast

PSEditions

Desktop Core

Dependencies

This module has no dependencies.

Release Notes

1.2.1

Added:
- Twenty-one named gradients, such as Rainbow, Sunset, Ocean and Progress, for -Gradient and -BackGroundGradient.
- Gradient options: -GradientSpace LinearRGB, OKLCH, HSL, HSV, Lab and LCh, -GradientHue, -GradientEasing (31 curves), -GradientRepeat, -GradientDirection and -GradientSteps.
- Gradient colors placed with '@', as a percent: 'Gold@40'.
- Get-GradientColor returns a gradient's colors, for a number of characters or at several places.
- Get-ColorContrast returns the WCAG contrast ratio of a color on a background.
- -ColorSupport on Write-ColorEX and Format-ColorEX names the color support to write for.
- Test-AnsiSupport reports SupportsUnicode; WRITECOLOREX_UNICODE sets it.
- Import-ColorProfile -Theme: Catppuccin, Solarized, Gruvbox, Dracula, Nord, One Dark, Tokyo Night, PowerShell's own colors and the CSS color names.
- Show-ColorTable -Styles, -Palette and -Profiles.
- The about_PSWriteColorEX help topic, a cheat sheet by task.

Changed:
- In 256 colors, each color is written as the code that looks nearest to it, measured in OKLab.
- Each gradient stop falls on a character of its own, so every color given is drawn exactly.
- A text gradient leaves out white space, which shows no text color.
- -Style reads a list as the array it holds.
- Every command that returns objects declares their type.
- Test-AnsiSupport turns on escape codes in a console without compiling C#.

Fixed:
- A style value outside its parameter's set gives the parameter check's error and the text is written, inside a try or not.
- The Write-Color* helpers write a refused profile's error and go on.
- The module keeps working in a runspace after another runspace that imported it is disposed, in Windows PowerShell 5.1 and PowerShell 7.
- Runspaces that import the module at the same moment all finish in Windows PowerShell 5.1.

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.1 (current version) 5 10/21/2026
1.2.0 20 10/9/2026
1.1.0 11 10/6/2026