Export the PowerShell output to a text file in tab-delimited format

csv, powershell

Solution

Use the `Export-CSV` with a tab delimiter. Note, that you can't use the output of `format-table` as an input to `export-CSV`, use `select-object` instead:

Get-MailboxStatistics -Database data01 |
  select displayname,databasename,itemcount,totalitemsize |
  export-csv -delimiter "`t" -path theOutFile.txt -notype

Problem

How do I save the PowerShell script output to a text file in tab-delimited format? Example - How do I export the output of the below PowerShell script to text, tab-delimited format? ``` Get-MailboxStatistics -Database data01 |ft displayname,databasename,itemcount,totalitemsize ```

Original source