没有标题的Powershell export-csv? [英] Powershell export-csv with no headers?

查看:227
本文介绍了没有标题的Powershell export-csv?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我试图导出没有标题的资源列表.基本上,我需要省略第1行名称".

So I'm trying to export a list of resources without the headers. Basically I need to omit line 1, "Name".

这是我当前的代码:

Get-Mailbox -RecipientTypeDetails RoomMailbox,EquipmentMailbox | Select-Object Name | Export-Csv -Path "$(get-date -f MM-dd-yyyy)_Resources.csv" -NoTypeInformation

我看了几个示例和要尝试的东西,但是还没有什么工作要做,仍然只列出了资源名称.

I've looked at several examples and things to try, but haven't quite gotten anything to work that still only lists the resource names.

有什么建议吗?预先感谢!

Any suggestions? Thanks in advance!

推荐答案

听起来您基本上只想给文件名称列表发短信:

It sounds like you basically want just text a file list of the names:

Get-Mailbox -RecipientTypeDetails RoomMailbox,EquipmentMailbox |
 Select-Object -ExpandProperty Name | 
 Set-Content -Path "$(get-date -f MM-dd-yyyy)_Resources.txt"

如果您确实想要没有标题行的export-csv:

if you really want an export-csv without a header row:

(Get-Mailbox -RecipientTypeDetails RoomMailbox,EquipmentMailbox |
Select-Object Name |
ConvertTo-Csv -NoTypeInformation) |
Select-Object -Skip 1 |
Set-Content -Path "$(get-date -f MM-dd-yyyy)_Resources.csv"

这篇关于没有标题的Powershell export-csv?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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