您如何使用 PowerShell 2.0 进行“暂停"? [英] How do you do a ‘Pause’ with PowerShell 2.0?

查看:78
本文介绍了您如何使用 PowerShell 2.0 进行“暂停"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我输了.PowerShell 很烦我.我希望出现一个暂停对话框,但它不会.

OK, I'm losing it. PowerShell is annoying me. I'd like a pause dialog to appear, and it won't.

PS W:\>>> $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Exception calling "ReadKey" with "1" argument(s): "The method or operation is not implemented."
At line:1 char:23
+ $host.UI.RawUI.ReadKey <<<< ("NoEcho")
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

推荐答案

cmd /c pause | out-null

(这不是 PowerShell 的方式,但它更优雅.)

(It is not the PowerShell way, but it's so much more elegant.)

保护树木.使用单衬.

这篇关于您如何使用 PowerShell 2.0 进行“暂停"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆