powershell - 在没有 `-y`开关的情况下使用Powershell ISE时,为什么Chocolatey会挂起?

标签 powershell powershell-ise chocolatey

在将PowerShell ISE与Chocolatey一起使用时,如果我忘记了-y开关,它会挂起,等待某种未在任何地方弹出的“确认”?

我必须按Ctrl + Alt + Del组合键才能杀死PowerShell ISE和Chocolatey,这会使事情处于中途状态。

如下所示:

Screenshot

最佳答案

除了上述OP的注释外,有关PowerShell ISE不支持(大多数)交互式控制台应用程序的信息...

值得记住的是, PowerShell_ISE.exe 中的REPL窗口不仅仅是某种停靠的 PowerShell.exe 控制台。在大多数情况下,用户体验是相同的,但这隐藏了许多差异:

  • https://blogs.msdn.microsoft.com/powershell/2009/04/17/differences-between-the-ise-and-powershell-console/

  • 这两个可执行文件都是运行PowerShell运行空间(引擎)的主机应用程序。您甚至可以编写自己的“托管” PowerShell的应用程序。决定用户体验的是主机应用程序。
  • PowerShell.org: The Shell vs The host
  • Spiceworks.com: The Shell vs The Host
  • Writing a Windows PowerShell Host

  • 最后,对于最好奇的人:
  • How PowerShell works


  • 我想我写这个答案更多是为了我自己的利益。对我而言,这是一次有用的复习,因为我时不时地被同事问到这一点...

    关于powershell - 在没有 `-y`开关的情况下使用Powershell ISE时,为什么Chocolatey会挂起?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48120827/

    相关文章:

    powershell - PowerShell ISE:如何运行新的PowerShell版本

    Powershell ISE缓存变量值?

    package - 如何使用来自 chocolateyInstall.ps1 的 Chocolatey 包中的 EXE?

    powershell - PowerShell尾文件,但忽略匹配模式的行

    function - PowerShell函数的返回值和返回变量的进一步使用

    powershell - 如何更改 Visual Studio 代码 'Powershell Integrated Console'?

    docker - 命令 'cmd/S/C choco install --no-progress -y curl'返回了非零代码:3221225785

    powershell - 使用Write-Error在Powershell中写入错误流

    windows - 使用 PowerShell 反引号执行代码片段不起作用

    windows - 如何重新编译 Chocolatey 虚拟包?