PowerTip: PowerShell Tabs

Doctor Scripto

Summary: Understand Windows PowerShell tabs.

Hey, Scripting Guy! Question How can I use Windows PowerShell to efficiently add 1, 2, or 3 tabs to a string?

Hey, Scripting Guy! Answer Use the `t character for a single tab. Use `t`t for two tabs, and multiply them for three or more (such as “`t”*3).
           Here are examples:

PS C:\> "this has a `t in it"

this has a       in it

PS C:\> "this has 2 `t`t in it"

this has 2               in it

PS C:\> "this has 3" + "`t"*3 + "in it"

this has 3                      in it

0 comments

Discussion is closed.

Feedback usabilla icon