Table of Contents

Class PsOutput

Namespace
SunamoSelenium
Assembly
SunamoSelenium.dll

Provides methods for invoking PowerShell commands and processing their output.

public class PsOutput
Inheritance
PsOutput
Inherited Members
Extension Methods

Methods

InvokeAsync(PowerShell)

Asynchronously invokes a PowerShell pipeline and returns the output as a list of strings. If errors occurred, returns formatted error messages instead.

public static Task<List<string>> InvokeAsync(PowerShell powerShell)

Parameters

powerShell PowerShell

The PowerShell instance to invoke.

Returns

Task<List<string>>

A list of strings containing either the output or error messages.

ProcessErrorRecords(PSDataCollection<ErrorRecord>)

Processes a collection of PowerShell error records into formatted string messages.

public static List<string> ProcessErrorRecords(PSDataCollection<ErrorRecord> errors)

Parameters

errors PSDataCollection<ErrorRecord>

The collection of error records to process.

Returns

List<string>

A list of formatted error messages.

ProcessPSObjects(ICollection<PSObject>)

Converts a collection of PowerShell objects to a list of strings with Unix line endings.

public static List<string> ProcessPSObjects(ICollection<PSObject> collection)

Parameters

collection ICollection<PSObject>

The collection of PowerShell objects to process.

Returns

List<string>

A list of string representations with Unix line endings.