Skip to content
This repository was archived by the owner on Dec 13, 2022. It is now read-only.
This repository was archived by the owner on Dec 13, 2022. It is now read-only.

It works when you run it yourself, but can't you read bash in the code? #14

@cyberprophet

Description

@cyberprophet
        using (var process = new Process
        {
            StartInfo = new ProcessStartInfo
            {
                Verb = "runas",
                FileName = "powershell",
                UseShellExecute = false,
                WorkingDirectory = @"C:\Users\T2\source\repos\Algorithmic-Trading-Server",
                RedirectStandardOutput = true,
                RedirectStandardError = true,
                RedirectStandardInput = true
            }
        })
        {
            process.ErrorDataReceived += (sender, e) =>
            {
                Debug.WriteLine(e.Data);
            };
            process.OutputDataReceived += (sender, e) =>
            {
                Debug.WriteLine(e.Data);
            };
            if (process.Start())
            {
                process.StandardInput.WriteLine("PowerShell.exe -ExecutionPolicy Bypass -File port.ps1");
                process.BeginOutputReadLine();
                process.BeginErrorReadLine();
                process.StandardInput.Close();
                process.WaitForExit();
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions