如何在Windows power shell中处理用户交互命令?

如何在Windows power shell中处理用户交互命令?,windows,powershell,Windows,Powershell,我需要从Windows power shell执行以下命令: PS C:\automation> ./test.exe get data "user\test" --outputfile test.csv Please enter the Password: Connecting database... out file available in test.csv PS C:\automation> 我需要输入密码,当它提示输入密码时,在“请输入密码:”。然后它将连接数据库并给

我需要从Windows power shell执行以下命令:

PS C:\automation> ./test.exe get data "user\test" --outputfile test.csv

Please enter the Password:
Connecting database...
out file available in test.csv
PS C:\automation> 
我需要输入密码,当它提示输入密码时,在“请输入密码:”。然后它将连接数据库并给出输出文件


请指导我如何在不使用任何“子流程”或“pexpect”之类的东西的情况下实现自动化。

您可以使用作为python模块的wexpect。否则,请使用我创建的模块

示例powershell脚本附加在该zip中。 请阅读以下内容:


确保安装了最新的Microsoft VC++可再发行版本

您是否询问如何自动输入
test.exe
的密码?这不是它的
--password
参数的作用吗(请参见您的命令)?10/10将再次自动执行。@Bill\u Stewart我的天哪。。。这就是打字错误。现在看我修改过的问题。谢谢。你是说
test.exe
没有
--password
参数?你可能不能。它取决于
test.exe
的设计。我建议问问节目的作者。