Table of Contents

Class PsOutput

Namespace
SunamoPS
Assembly
SunamoPS.dll

Base class for processing PowerShell output and error records.

public class PsOutput
Inheritance
PsOutput
Derived
Inherited Members
Extension Methods

Methods

InvokeAsync(PowerShell)

Invokes a PowerShell instance asynchronously and returns output or error messages.

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

Parameters

powerShell PowerShell

PowerShell instance to invoke.

Returns

Task<List<string>>

List of output or error strings.

ProcessErrorRecords(PSDataCollection<ErrorRecord>)

Converts a collection of ErrorRecords into a list of formatted error strings.

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

Parameters

errors PSDataCollection<ErrorRecord>

Collection of PowerShell error records.

Returns

List<string>

List of formatted error strings.

ProcessPSObjects(ICollection<PSObject>)

Converts a collection of PSObjects into a list of strings with Unix line endings.

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

Parameters

psObjects ICollection<PSObject>

Collection of PowerShell objects.

Returns

List<string>

List of string representations.