AvalonStudio.CommandLineTools.PlatformSupport.ExecuteShellCommand C# (CSharp) Method

ExecuteShellCommand() public static method

public static ExecuteShellCommand ( string commandName, string args ) : ShellExecuteResult
commandName string
args string
return ShellExecuteResult
        public static ShellExecuteResult ExecuteShellCommand(string commandName, string args)
        {
            var outputBuilder = new StringBuilder();
            var errorBuilder = new StringBuilder();

            var exitCode = ExecuteShellCommand(commandName, args,
            (s, e) =>
            {
                outputBuilder.AppendLine(e.Data);
            },
            (s, e) =>
            {
                errorBuilder = new StringBuilder();
            },
            false, "");

            return new ShellExecuteResult()
            {
                ExitCode = exitCode,
                Output = outputBuilder.ToString().Trim(),
                ErrorOutput = errorBuilder.ToString().Trim()
            };
        }

Same methods

PlatformSupport::ExecuteShellCommand ( string commandName, string args, DataReceivedEventArgs>.Action outputReceivedCallback, DataReceivedEventArgs>.Action errorReceivedCallback = null, bool resolveExecutable = true, string workingDirectory = "", bool executeInShell = true ) : int