I need to automate some tasks against a legacy application. It doesn't have an API, but the vendor offers a .exe I can run to perform various tasks against the application.
I can call the .exe from within PowerShell just fine, but after calling it it prompts for the following input:
Do you agree to the license: YES User name: myuid Password: SuperSecretPassword`
I can run this interactively from the command prompt just fine and manually enter the requested input as prompted, but I need to automate this in a script. The .exe doesn't accept any command line parameters for this either(it's an old app), the only parameters I can pass are the commands I want to execute against the application. The .exe is only command line based with no GUI, so GUI automation tools aren't an option either.
I could do this easily with expect
in a *nix shell, however given that I have a .exe I need to run, that's out of the question. There doesn't appear to be an "expect" equivalent in Windows, so I'm curious if this can be accomplished in PowerShell?
Note: For Windows scripts I prefer PowerShell, but could utilize VBScript if necessary.