User input for external program in Powershell -
i'm writing powershell script calls external programme this:
& $toollocation $toolparameters the programme - console application - runs fine, @ end waits user press come in finish , exit. accomplish script not stopping @ point waiting user input, continues automatically. possible? if yes, how?
thanks in advance.
whatever program, can utilize wscript.shell utilise sendkeys method.
i have tested on following:
$wscript = new-object -com wscript.shell start-process -filepath cmd.exe -argumentlist "/c pause" ; start-sleep -seconds 1; $wscript.sendkeys("{enter}") this has spawned me cmd.exe pause prompt 'closed' sendkeys. of course of study depends on window behaviour - sendkeys sends keys active window, , if application calling not active, there couple of tricks...
hope helps
powershell powershell-v3.0
No comments:
Post a Comment