I will appreciate help with the following question.
In PowerShell, how can I read data from the standard output (Data that is generated by an automated process, and not by a user)?
Consider the following scenario:
A. A Java App launches a VBScript program (by running “cscript.exe”)
B. While the VBScript is running, the Java app writes data into the standard output.
C. The VBScript reads this information from the standard input (using Wscript.StdIn.ReadLine) .
I want to convert the VBScript program to PowerShell. I tried to use “Read-Host” to read data from the standard input, but it waits endlessly (probably waiting for user to press “Enter”).
So how can I do something similiar to VBScript “Wscript.StdIn.ReadLine” in PowerShell?
Best Regards,
Tal