0

我有一个 .exe 程序,我需要在启动时在 docker 中运行它。我可以从容器的 powershell 运行它而不会出现任何错误,但不能从 powershell 脚本文件运行它。

  • 容器名称:基础
  • exe文件名:abc.exe

.exe 按预期运行,没有任何错误:

  • docker-compose ecex base powershell
  • PS C:\> abc.exe -someParam xyz

但是当我从 powershell 脚本文件中调用它时,它给了我以下错误:

runexe.ps1 文件:

# run 
abc.exe -someParam xyz

错误 :

Unhandled Exception: System.InvalidOperationException: Showing a modal dialog 
box or form when the application is not running in UserInteractive mode is not a 
valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to
display a notification from a service application.
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)

那么,我该如何克服这个问题呢?提前致谢。

4

1 回答 1

0

使用Start-Processpowershell cmdlet 来控制 docker build 中 EXE 的执行,它可以更好地控制进程的生命周期

于 2018-04-12T11:46:36.443 回答