Skip to content
ConsoleMonster
Cmdlet

Write-ConsoleStatus

Module ConsoleMonster
Inputs
None

Shows one status line that updates in place, with an optional spinner, clock and elapsed time.

Syntax

Write-ConsoleStatus [-BackgroundColor <Object[]>] [-ClockFormat <String>] [-Color <Object[]>] [-Complete] [-Markup <String>] [-Role <ThemeToken>] [-ShowClock] [-ShowElapsed] [-Spinner] [-Status <StatusKind>] [-Style <String[]>] [[-Text] <Object[]>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Shows one status line that updates in place, with an optional spinner, clock and elapsed time.

Each call replaces the line (Write-Color style pieces, colours, -Markup, -Style and -Role as in Write-ConsoleText). -Spinner, -ShowClock and -ShowElapsed keep refreshing about ten times a second between calls. -Complete writes the final line (with -Status Pass, Fail or Warn for a marker) and moves on. The refresh stops by itself when other output or the prompt moves the cursor, so it never draws over them. In redirected output, CI, transcripts, jobs and other non-console hosts each call writes a normal line instead (unchanged repeats are skipped).

Examples

Authored help example

EXAMPLE 1

Write-ConsoleStatus -BackgroundColor @('Value')

Parameters

-BackgroundColor Object[] optionalaliases: B, BGC
Background colour per piece.
-ClockFormat String optionalaliases: DateTimeFormat
The clock format (default HH:mm:ss).
-Color Object[] optionalaliases: C, FGC, ForegroundColor
Foreground colour per piece.
-Complete SwitchParameter optional
Writes the final version of the line and ends it.
-Markup String optional
Markup added after the pieces.
-Role ThemeToken optional
A theme role for pieces without their own colour.
Possible values: Text, Muted, Subtle, Accent, Accent2, Pass, Fail, Warn, Info, Skip, Running, Pending, Border, Title, Header, Highlight, Surface, SurfaceAccent, Series1, Series2, Series3, Series4, Series5, Series6, Focus
-ShowClock SwitchParameter optional
Shows the time of day, refreshed every second.
-ShowElapsed SwitchParameter optional
Shows the time since the status line started.
-Spinner SwitchParameter optional
Shows a spinner while the status is open.
-Status StatusKind optional
A status marker before the text (Pass, Fail, Warn, Info, Running...).
Possible values: Pending, Running, Pass, Fail, Warn, Skip, Info
-Style String[] optional
Decorations: Bold, Dim, Italic, Underline, Strikethrough, Invert.
-Text Object[] optionalposition: 0aliases: T
Text pieces, shown literally (strings, or rich text from New-ConsoleText).

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.