powershell 越狱 >>

powershell escape from >>

我刚接触 PowerShell,遇到了这个问题: 如果我在命令末尾放置转义字符 (') 或单引号 ("),PowerShell 会进入 suspend/whatever 模式,其中屏幕左侧有“>>”,而不是 "PS C:>",我知道 PS 只是对我有更多 information/commands/whatever 的期望,这就是为什么它为我提供了新的台词等等,但我如何 escape/stop 呢?甚至按下 "Enter" 几次后,PS 只是为我提供了更多 >> s,我想结束我的输入并完成命令,到目前为止我无法找到任何相关信息,主要是因为我都不知道它叫什么

它正在等待右引号或大括号 },因此您可以输入其中一个并再按两次回车键,或者使用 Crtl+C取消当前命令。

仅供参考:

' = literal quote (expects another single quote)
" = quotes to use when interpolating strings (expects another double quote)
` = escape character (continuation of the current line)
, = list separator (expects another list element)
{ = begin of script block (expects closing curly bracket)

只要你正在做的事情是平衡的,按两次回车就会退出这个块。如果你想开始其他任何事情,你会在第一次按下时得到另一个 >>,否则它会 return 你到提示符。