Greeting,
I have an old command line application call Commandline.exe. it run with a parameter to check then show the result. but it need extra "Enter" to confirm
like:
commandline.exe -s 4567890
1. So I preparing the an answer file which is on an "Enter" (crlf) inside it. called c:\apps\answer.txt.
use command line in command prompt: (pipe to feed commandline.exe that "Enter"
type c:\apps\answer.txt | c:\apps\commandline.exe -s 4567890
it works
2. So in powershell I assembly them together like below,
cmd.exe /c type c:\apps\answer.txt | c:\apps\commandline.exe -s 4567890
It works in powershell command line as well. but with other code together it does not any more.
$cmd="type c:\apps\answer.txt | c:\apps\commandline.exe -s 4567890"
3. The idea is parameter 45567890 is created by other powershell code , and I do not want to be clear text on the command line.
Thanks and Best Regards,
userausera