如何在PowerShell中键入TAB字符? [英] How do I type a TAB character in PowerShell?

查看:319
本文介绍了如何在PowerShell中键入TAB字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任务:默认情况下,在Windows命令提示符下按TAB键将输出文件名,而在PowerShell中不执行任何操作。我希望能够以交互方式而不是通过脚本键入TAB字符。

Task: By default, pressing the TAB key while in Windows Command Prompt will output file names, while it does nothing in PowerShell. I want to be able to type the TAB character in interactive mode, not via scripts.

研究:我在该网站上发现了类似的问题,并且通过Google搜索。找到的解决方案是针对 bash (Mac)或< a href = https://stackoverflow.com/questions/10627989/how-do-i-insert-a-tab-character-in-iterm> iterm (Linux),或建议更改为其他程序例如 TweakUI 。我的问题特定于Windows PowerShell或命令提示符。

Research: I found similar questions on this site and via Google search. Solutions found were addressing bash (Mac) or iterm (Linux), or suggested changing to another program such as TweakUI. My question is specific to Windows PowerShell or Command Prompt.

说明:对于您的问题是否有效的简单测试是键入在PS / CP中回显 1 TAB方法2 ,其中TAB方法是有关如何插入TAB字符的建议。如果回声给出 1 2 (即1,后跟TAB空格,后跟2),这就是我要的内容。希望能对您有所帮助,并感谢大家花时间查看问题。

Clarification: A simple test for whether your answer works for my question is to type echo "1 TAB-method 2" into PS/CP, where TAB-method is your suggestion on how to insert a TAB character. If the echo gives 1 2 (i.e. 1 followed by a TAB space followed by 2), that's what I'm looking for. Hope that helps, and thanks everyone for taking the time to look at the question.

推荐答案

如果有帮助,您可以嵌入标签用双引号引起来的字符:

If it helps you can embed a tab character in a double quoted string:

PS> "`t hello"

这篇关于如何在PowerShell中键入TAB字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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