以制表符分隔的格式将PowerShell输出导出到文本文件

时间:2023-01-16 19:51:30

How do I save the PowerShell script output to a text file in tab-delimited format?

如何以制表符分隔的格式将PowerShell脚本输出保存到文本文件?

Example - How do I export the output of the below PowerShell script to text, tab-delimited format?

示例 - 如何将以下PowerShell脚本的输出导出为文本,制表符分隔格式?

Get-MailboxStatistics -Database data01 |ft displayname,databasename,itemcount,totalitemsize

1 个解决方案

#1


38  

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:

将Export-CSV与制表符分隔符一起使用。注意,您不能使用format-table的输出作为export-CSV的输入,而是使用select-object:

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

#1


38  

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:

将Export-CSV与制表符分隔符一起使用。注意,您不能使用format-table的输出作为export-CSV的输入,而是使用select-object:

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