Skip to content

Crash when prompt is undefined in the runspace #1699

Closed
@dkattan

Description

@dkattan

When "prompt" isn't defined in the runspace the fallback to DefaultPrompt doesn't work because we aren't catching the CommandNotFoundException

var command = new PSCommand().AddCommand("prompt");
IReadOnlyList<string> results = InvokePSCommand<string>(command, PowerShellExecutionOptions.Default, cancellationToken);
string prompt = results.Count > 0 ? results[0] : DefaultPrompt;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions