How to add a tab to a text file

format, powershell, text

Solution

"`t" will output a tab character.

Problem

I am running a `for` loop that would query for certain services and then output the services and their selected properties to a text file on each separate line where each property is separated by a tab, but I haven't figured out how to add a tab to a text file. For instance, this is current set of strings in my code: ``` write-output $server, $servicename, $status, $startname | out-file -append output.txt ``` I would like to append the above string to output.txt, so it would appear like this: ``` server1 <tab> servername <tab> status <tab> startname server2 <tab> servername <tab> status <tab> startname ```

Original source

Related problems