我有一个Powershell Commandlet,它根据条件提示用户输入安全字符串。现在,我想自动测试这个命令小程序,为此,我使用Powershell远程运行空间来调用这个命令小程序。Try a host program that supports user interaction, such as the Windows PowerShell Console or WindowsPowerShell ISE, and remove prompt-related commands from command types t
如果我将这段c#代码编译成一个可执行文件并在Windows命令shell中运行,它运行得很好:输出提示符,在同一行中等待一些用户输入,然后按enter键,回显该输入。在PowerShell v3外壳中运行时,它也运行得很好。但是,如果我在PowerShell ISE V3中运行相同的EXE文件,它永远不会从Write发出输出,并且会在ReadLine上挂起。