If I compile this c# code to an EXE file and run in a Windows command shell it runs fine: outputting the prompt, waiting on the same line for some user input followed by enter, echoing that input. Running in a PowerShell v3 shell it also runs fine. If, however, I run this same EXE file in PowerShell ISE V3, it never emits output from Write
and it hangs on the ReadLine
. (As an aside, it will emit output from Write
if it is later followed by a WriteLine
.)
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
System.Console.Write("invisible prompt: ");
var s = System.Console.ReadLine();
System.Console.WriteLine("echo " + s);
}
}
}
Is this an ISE bug or is there some property to adjust to make it work...?