Skip to content

Start-SpectreRecording

Description

Starts a recording of the current console output. This can be used to record all of the spectre console interactions in a PowerShell session.
I’ve used this to record the examples on the docs help site.


Examples

Example 1
This example demonstrates how to record the spectre console output.

Terminal window
$recording = Start-SpectreRecording -RecordingType "Html" -CountdownAndClear
# Use spectre console functions, these will be recorded
Write-SpectreHost "Hello [red]world[/]"
# Finish the recording
$result = Stop-SpectreRecording
# Output the results
Write-SpectreHost "Result:`n$result"

Parameters

Width

The width of the recording.

TypeRequiredPositionPipelineInput
[Int32]false1false

Height

The height of the recording.

TypeRequiredPositionPipelineInput
[Int32]false2false

RecordingType

The type of recording to create.

Valid Values:

  • asciinema
  • text
  • html
TypeRequiredPositionPipelineInput
[String]false3false

CountdownAndClear

If this switch is present, the console will be cleared and a countdown will be displayed before the recording starts.

TypeRequiredPositionPipelineInput
[Switch]falsenamedfalse

Syntax

Terminal window
Start-SpectreRecording [[-Width] <Int32>] [[-Height] <Int32>] [[-RecordingType] <String>] [-CountdownAndClear] [<CommonParameters>]