krkarthik_info
6 years agoFrequent Contributor
How to capture the powershell result on calling the external application(.exe with arguments)
Hi All,
I am trying to run powershell command through TestComplete, command to call the external application(.exe) with argument. And the command returns the message to the powershell console.
Unable to read the message displayed in the powershell console through TestComplete.
Below is the format of the command am using to exec through TestComplete:
var PowerShellObj = Sys.OleObject("WScript.Shell"); var Command = "C:\cmd_tool.exe --list-data"; var oExec = PowerShellObj.Exec("powershell -command "+Command );
Note:
Manually when I run the same command in powershell console, I could see the message displayed on the console.
Thanks in advance.
Thanks,
Karthik K R
Hi Robert,
Thanks for the suggestion.
I have got the problem resolved. I was using the StdOut.ReadAll() to get the console output.
Thanks,
Karthik K R