Skip to content
ConsoleMonster
Cmdlet

Write-ConsoleLogEntry

Module
ConsoleMonster
Inputs
System.Object

Writes a line to the log region of a running dashboard.

Syntax

Write-ConsoleLogEntry
[-Highlight <String>]
[-Level <String>]
[-Message] <Object>
[-Session <LiveSession>]
[-WidgetId <String>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

-Level sets the tag: info, warn, err, verbose, debug, pass or skip, or PowerShell's words (Information, Warning, Error, Success...). Errors, warnings, passes and skips carry a status marker; only warnings and errors are coloured. Write-Host in a dashboard runspace reaches the same log automatically.

Examples

Example 1

Write-ConsoleLogEntry 'DC03 responded slowly' -Level warn

Log a warning

Parameters

-Highlight String optional
Highlights the message: Smart (numbers, booleans, GUIDs, IP addresses, URLs, paths, dates, DNs, quoted strings) or a language such as Json or PowerShell. The message stays literal.
-Level String optional
The level: info, warn, err, verbose, debug, pass or skip. PowerShell's words work too: Information, Warning, Error, Verbose, Debug, Success, Skipped (and the status words of Show-ConsoleStatusLine).
-Message Object requiredposition: 0pipeline: True (ByValue)
The message.
-Session LiveSession optional
The live session to update. Defaults to $ConsoleSession or the running dashboard.
-WidgetId String optional
The log name; defaults to the dashboard's log region.

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.