I am have a trouble writing a PowerShell wrapper around some batch files. I
have a wrapper working using WScript/VBScript but I would like to move to
PowerShell.
The working WScript/VBScript code echos 'y' into a make.bat prompt. CODE 123
VER 1.2.3 are parameters for make.bat and I'm redirecting stderr to stdout.
Stdout is dumped into a log file (and monitored for errors, code not shown).
set oExec = oShell.Exec("%comspec% /c echo y | make.bat CODE 123 VER 1.2.3
2>&1")
Do Until oExec.StdOut.AtEndOfStream
sReadLine = oExec.StdOut.ReadLine()
fLog.Writeline sReadLine
loop
I can get the make batch file to run and pipe 'y' into it, but can't get the
parameters passed into it.
echo y | make.bat "CODE 123 VER 1.2.3 2>&1" >build.log
Is there a PowerShell method of implementing the
'Do Until oExec.StdOut.AtEndOfStream
sReadLine = oExec.StdOut.ReadLine()'
functionality?
TIA


