Table of Contents

Class PowershellRunnerString

Namespace
SunamoPS
Assembly
SunamoPS.dll

PowerShell runner that returns results as single joined strings instead of lists. Delegates all operations to the main PowershellRunner instance.

public class PowershellRunnerString
Inheritance
PowershellRunnerString
Inherited Members
Extension Methods

Properties

Instance

Singleton instance of PowershellRunnerString.

public static PowershellRunnerString Instance { get; }

Property Value

PowershellRunnerString

Methods

InvokeInFolder(string, string)

Invokes a command in a specified folder and returns the output as a single string.

public Task<string> InvokeInFolder(string folder, string command)

Parameters

folder string

Folder to change to before executing.

command string

Command to execute.

Returns

Task<string>

Command output as a newline-joined string.

InvokeLinesFromString(string, bool)

Invokes commands parsed from a multi-line string and returns combined output as a string.

public Task<string> InvokeLinesFromString(string text, bool isWritingProgressBar)

Parameters

text string

Multi-line string of commands.

isWritingProgressBar bool

Whether to write progress bar updates.

Returns

Task<string>

Combined output as a newline-joined string.

InvokeProcess(string, string, InvokeProcessArgsPS?)

Invokes an external process and returns its output as a single string.

public Task<string> InvokeProcess(string exeFileNameWithoutPath, string arguments, InvokeProcessArgsPS? processArgs = null)

Parameters

exeFileNameWithoutPath string

Executable file name without full path.

arguments string

Command-line arguments for the process.

processArgs InvokeProcessArgsPS

Optional process invocation arguments.

Returns

Task<string>

Process output as a newline-joined string.

InvokeSingle(string)

Invokes a single command and returns its output as a string.

public Task<string> InvokeSingle(string command)

Parameters

command string

Command to execute.

Returns

Task<string>

Command output as a newline-joined string.