我可以在 PowerShell 脚本中禁用选择模式吗? [英] Can I disable select mode in a PowerShell script?

查看:51
本文介绍了我可以在 PowerShell 脚本中禁用选择模式吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PowerShell 默认是当您在 PowerShell 控制台内单击时,PowerShell 会进入选择模式"并暂停脚本,直到您点击空格、输入或转义.

PowerShell default is that when you click inside the PowerShell console, PowerShell goes into "select mode" and pauses the script until you hit space, enter or escape.

我有一个无限循环的脚本 while ($true) {} 应该总是运行,当有人不小心点击进入 PowerShell 窗口时,我如何告诉 PowerShell 不要停止脚本?

I have a Script with an infinite-loop while ($true) {} which should always run, how can I tell PowerShell to not stop the script when someone accidentally clicks into the PowerShell window?

推荐答案

在 Windows PowerShell 中,这可以通过以下方式实现:

In Windows PowerShell, this can be achieved by:

  1. 右键单击 PowerShell 窗口图标;

  1. 选择属性";

  1. Select "Properties";

禁用编辑选项">快速编辑模式".

Disable "Edit Options" > "QuickEdit Mode".

这篇关于我可以在 PowerShell 脚本中禁用选择模式吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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