Skip to content

Write-SpectreHost

Description

The Write-SpectreHost function writes a message to the console using Spectre Console. It supports ANSI markup and can optionally append a newline character to the end of the message. The markup language is defined at https://spectreconsole.net/markup Supported emoji are defined at https://spectreconsole.net/appendix/emojis


Examples

Example 1
This example demonstrates how to write a message to the console using Spectre Console markup.

Terminal window
Write-SpectreHost -Message "Hello, [blue underline]world[/]! :call_me_hand:"

Parameters

Message

The message to write to the console.

TypeRequiredPositionPipelineInput
[Object]true1true (ByValue)

NoNewline

If specified, the message will not be followed by a newline character.

TypeRequiredPositionPipelineInput
[Switch]falsenamedfalse

PassThru

TypeRequiredPositionPipelineInput
[Switch]falsenamedfalse

Justify

Valid Values:

  • Left
  • Right
  • Center
TypeRequiredPositionPipelineInput
[String]false2false

Syntax

Terminal window
Write-SpectreHost [-Message] <Object> [-NoNewline] [-PassThru] [[-Justify] <String>] [<CommonParameters>]