Project

PSWriteColor

Write-Color is a wrapper around Write-Host allowing you to create nice looking scripts, with colorized output.

Stars195
Forks28
Open issues5
PowerShell Gallery downloads1120317
Releasev1.0.3
Language: PowerShell Updated: 2026-04-11T10:18:48.0000000+00:00

Curated Examples

Add readable status output to scripts

Use PSWriteColor to make status messages, menus, and success feedback easier to scan.

This example is a good first stop if you want to replace plain Write-Host output with something operators can scan quickly.

It comes from the source example at Examples/Write-Color-Examples.ps1.

When to use this pattern

  • You want progress and status messages to stand out in the console.
  • Your scripts present simple operator choices.
  • You need readable output without building a full TUI experience.

Example

Import-Module .\PSWriteColor.psd1 -Force

Write-Color "[i] ", "Sending email...." -Color White, White -NoNewLine
if ($true) {
    Write-Color -Text "OK" -Color Green
}

Write-Color "1. ", "Option 1" -Color Yellow, Green
Write-Color "2. ", "Option 2" -Color Yellow, Green
Write-Color "9. ", "Press 9 to exit" -Color Yellow, Gray -LinesBefore 1

What this demonstrates

  • mixing plain labels with highlighted status text
  • showing success feedback inline
  • building lightweight operator menus without a complex UI layer

Source