简体   繁体   English

Powershell调用命令行应用程序并在出现提示时传递变量

[英]Powershell call command line application and pass variables when prompted

I have a command line application I would like to call from inside a Powershell script. 我有一个命令行应用程序,我想从Powershell脚本中调用。 The purpose of doing so is so I can pass it values calculated by the script. 这样做的目的是使我可以传递脚本计算的值。 Unfortunately the application does not accept command line parameters, but interactively prompts the user for them. 不幸的是,该应用程序不接受命令行参数,而是以交互方式提示用户输入这些参数。

If I do a Write-Host after calling the command line application then the application must complete before the writes are done. 如果我在调用命令行应用程序后执行了Write-Host,则该应用程序必须在完成写入之前完成。 If I pipe the values using Write-Host into the application call, the application behaves as though nothing but return was entered for each of the prompts. 如果我使用Write-Host将值通过管道传递到应用程序调用中,则应用程序的行为就好像没有什么,只为每个提示输入了return。 Is there a way to do this? 有没有办法做到这一点?

我尝试一下: http : //wasp.codeplex.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM