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.
$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.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Int32] | false | 1 | false |
Height
The height of the recording.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Int32] | false | 2 | false |
RecordingType
The type of recording to create.
Valid Values:
- asciinema
- text
- html
Type | Required | Position | PipelineInput |
---|---|---|---|
[String] | false | 3 | false |
CountdownAndClear
If this switch is present, the console will be cleared and a countdown will be displayed before the recording starts.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Switch] | false | named | false |
Syntax
Start-SpectreRecording [[-Width] <Int32>] [[-Height] <Int32>] [[-RecordingType] <String>] [-CountdownAndClear] [<CommonParameters>]