Cmdlet
Write-ConsoleLogEntry
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 SetsDescription
-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 warnLog a warning
Parameters
- -Highlight String
- 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
- 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
- The message.
- -Session LiveSession
- The live session to update. Defaults to $ConsoleSession or the running dashboard.
- -WidgetId String
- 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.