ESC icon indicating copy to clipboard operation
ESC copied to clipboard

Character Limit on Console.ReadLine();

Open xenoantic opened this issue 4 years ago • 0 comments

I was trying to run an encoded PShell command and ran into an issue with the character limit of Console.Readline();

I added this and replaced the 2 instances of Console.Readline(); with ReadLine();

    public static string ReadLine()
    {
        byte[] inputBuffer = new byte[1024];
        Stream inputStream = Console.OpenStandardInput(inputBuffer.Length);
        Console.SetIn(new StreamReader(inputStream, Console.InputEncoding, false, inputBuffer.Length));
        string strInput = Console.ReadLine();
        return strInput;
    }

Tested and it works.

Thanks for the work on this project.

xenoantic avatar Feb 05 '21 21:02 xenoantic