Skip to content
ConsoleMonster

Coming from Write-Color

Write-ConsoleText takes the parameters and aliases of Write-Color from PSWriteColor. How they map, what it adds and where the two behave differently.

Write-ConsoleText accepts the parameters and aliases of Write-Color from PSWriteColor. ConsoleMonster does not define a Write-Color or wc alias, so the two modules can be loaded in the same session.

write-consoletext.ps1 Windows PowerShell 5.1
Deploying FS01 to Production
        √ copied 1,204 files
        Status: healthy
Collecting inventory ................... done
                                      Release 2026.10 is live
PowerShellwrite-consoletext.ps1
Write-ConsoleText -Text 'Deploying ', 'FS01', ' to ', 'Production' -Color Gray, Cyan, Gray, Yellow
Write-ConsoleText -Markup '[pass]√[/] copied 1,204 files' -StartTab 1
Write-ConsoleText -Text 'Status: ', 'healthy' -Color DarkGray, Green -StartSpaces 8
Write-ConsoleText -Text 'Collecting inventory ' -Color Gray -PadRight 40 -PadCharacter '.' -NoNewLine
Write-ConsoleText -Text ' done' -Color Green
Write-ConsoleText -Text 'Release 2026.10 is live' -Gradient '#38bdf8', '#c084fc' -HorizontalCenter
Write-ConsoleText on Windows PowerShell 5.1: pieces with colours, markup, tabs, spaces, padding with a character and a gradient.

Parameters

Write-ColorWrite-ConsoleTextNotes
-Text (-T)-Text (-T)Pieces are literal. Rich text from New-ConsoleText is accepted too.
-Color (-C, -ForegroundColor, -FGC)sameAlso theme roles, #RRGGBB, rgb() and r,g,b. Extra pieces take the first colour, as in Write-Color. Without -Color the terminal's own colour is used; Write-Color uses White.
-BackGroundColor (-B, -BGC)sameCounts don't have to match: extra pieces take the first background.
-StartTab (-Indent)sameEight cells per tab.
-StartSpaces, -LinesBefore, -LinesAftersame
-ShowTime, -DateTimeFormat (-DateFormat, -TimeFormat)same
-NoNewLinesameWorks in transcripts, jobs and the host route too.
-HorizontalCentersameMeasured in terminal cells, so emoji and CJK centre correctly.
-LogFile (-L), -LogTime (-LogTimeStamp), -LogRetrysameAppends under a file lock, with retries and warnings as in Write-Color.
-EncodingsameA new log defaults to UTF-8 without a byte order mark; Write-Color defaults to UTF-16. Appending to an existing log keeps its encoding, so last month's Write-Color log stays UTF-16, and a contradicting -Encoding warns.
-NoConsoleOutput (-HideConsole)same

Parameters that Write-ConsoleText adds

ParameterWhat it does
-Markup, -Style, -Link, -Role, -GradientMarkup after the pieces, decorations, hyperlinks, theme roles and colour gradients.
-PadLeft, -PadRight, -PadCenter, -PadCharacterPadding in terminal cells.
-Wrap, -WidthWraps with a hanging indent under the time and prefix.
-SplitLinesSplits at a separator and aligns the following lines under the first.
-LogFormat Text, Csv or JsonLines, -LogSeparator, -Level, -CategoryStructured logs.

Where the two behave differently

  • In transcripts, each call is one line.
  • In jobs and remoting, the colours travel with the output as information records.
  • Redirected output is plain text.
  • ConsoleColor names render as PowerShell shows them: DarkRed is ANSI red and Red is bright red, so a script looks the same as with Write-Host -ForegroundColor.

For a line that updates in place, use Write-ConsoleStatus 'Copying ', $file -Color Gray, Cyan -Spinner -ShowElapsed and end it with -Complete. Outside a real console it writes plain lines.

Edit this page on GitHub