Format-SpectreException
Description
Formats an error record/exception into a Spectre Console Exception which supports syntax highlighting.
See https://spectreconsole.net/exceptions for more information.
Examples
Example 1 # This example demonstrates how to format an exception into a Spectre Console Exception with syntax highlighting.
Parameters
Exception
The error/exception object to format.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Object] | true | 1 | true (ByValue) |
ExceptionFormat
The format to use when rendering the exception. The default value is “Default”.
Valid Values:
- Default
- NoStackTrace
- ShortenEverything
- ShortenMethods
- ShortenPaths
- ShortenTypes
- ShowLinks
Type | Required | Position | PipelineInput |
---|---|---|---|
[String] | false | 2 | false |
ExceptionStyle
The style to use when rendering the exception provided as a hashtable. e.g.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Hashtable] | false | 3 | false |