$ show EvotecIT/PSWriteColor
PSWriteColor is a PowerShell module that makes console output easier to scan by letting scripts write text with multiple foreground and background colors, padding, separators, timestamps, and optional log-file output. The core Write-Color function accepts parallel arrays of text and color, interleaves them on a single line, and supports line breaks, padding, and host fallback when RawUI dimensions are unavailable. It is designed for operational scripts that need clear status messages, prompts, or lightweight menus without pulling in a full TUI framework. The module can write to the console and a log file simultaneously, and it degrades gracefully in constrained hosts.
The LLM identified 4 files worth highlighting for reuse:
Core module implementing Write-Color, which interleaves text and color arrays, supports padding, background colors, separators, timestamps, and optional log files. Isolated as a single PowerShell module, so it can be imported into any script or module. Demonstrates robust console formatting with graceful degradation when RawUI dimensions are unavailable.
Pester tests that verify Write-Color's output contract, including an edge case where the host cannot provide RawUI dimensions. Shows how to test console output and logging behavior in a headless CI environment, making it a useful reference for testing formatting functions.
Focused tests for padding behavior, ensuring alignment and width handling. Provides a clean example of testing formatting edge cases in PowerShell and can be reused as a pattern for other formatting-focused modules.
Example script demonstrating a lightweight operator menu using colored output. Useful pattern for scripts that need interactive choices or clearer status prompts without a full TUI framework, and it is maintained as a curated example for the project documentation.