Hello,
I have a command line executable that connects to an API. In order to login i have to run the configure command at which time it prompts for user and then pw. It does now allow arguments to pass in. I tried running this script pilfered from various searches, but it stops after the Start-Process line and waits at the first prompt.
I call this from ssis execute process command that calls powershell.exe and passes the argument ExecutionPolicy Bypass -File “D:\ConfigureCredentials.ps1”
Contents of ConfigureCredentials.ps1":
$executablePath = “D:\acoms-cli.exe”
$username = “laksjdfhalsdjkfh”
$password = “alsdkfjhalsdfjkhaslkdfhalskdjfh”
$wshell = New-Object -ComObject WScript.Shell
$arg = “configure”
Start-Process -FilePath $executablePath -Argument $arg -NoNewWindow -Wait
Start-Sleep -Seconds 3
$wshell.SendKeys($username)
$wshell.SendKeys(“{ENTER}”)
Start-Sleep -Seconds 3
$wshell.SendKeys($password)
$wshell.SendKeys(“{ENTER}”)
any input or a different/better way of doing it is appreciated.
Thanks,
-Tim