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
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
Returns
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
textstringMulti-line string of commands.
isWritingProgressBarboolWhether to write progress bar updates.
Returns
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
exeFileNameWithoutPathstringExecutable file name without full path.
argumentsstringCommand-line arguments for the process.
processArgsInvokeProcessArgsPSOptional process invocation arguments.
Returns
InvokeSingle(string)
Invokes a single command and returns its output as a string.
public Task<string> InvokeSingle(string command)
Parameters
commandstringCommand to execute.