Skip to content
ConsoleMonster
Class

ConsoleDemo

ConsoleMonster.Demos

Namespace
ConsoleMonster.Demos
Assembly
ConsoleMonster
Modifiers
static

Types scripted demonstrations into a real PowerShell PTY and records its actual output.

Inheritance

  • object
  • ConsoleDemo

Methods

public static string Present(DemoScript script, DemoOptions? options = null, Func<ConsoleKeyInfo>? readKey = null, Action<int, int>? stepChanged = null, CancellationToken cancellationToken = default) #

Runs a live demo. Enter runs, Space types, b goes back, s skips and q quits. Back does not undo shell side effects.

Parameters

script ConsoleMonster.Demos.DemoScript required
The PowerShell demo.
options ConsoleMonster.Demos.DemoOptions? = null optional
Child and recording settings.
readKey System.Func<System.ConsoleKeyInfo>? = null optional
Optional key source; defaults to the current terminal.
stepChanged System.Action<int, int>? = null optional
Step counter callback, outside the captured child output.
cancellationToken System.Threading.CancellationToken = default optional
Stops the owned child when cancelled.

Returns

string
public static string Record(DemoScript script, DemoOptions? options = null, CancellationToken cancellationToken = default) #

Runs every step. The caller controls the child environment and reproducible input data through options.

Parameters

script ConsoleMonster.Demos.DemoScript required
options ConsoleMonster.Demos.DemoOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

string