powershell - 没有标题的Powershell export-csv?

标签 powershell export office365

因此,我正在尝试导出没有标题的资源列表。基本上,我需要省略第1行“名称”。

这是我当前的代码:

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

我看了几个示例和要尝试的事情,但是还没有得到什么工作,仍然只列出了资源名称。

有什么建议么?提前致谢!

最佳答案

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

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

编辑:如果您确实想要没有标题行的export-csv:
(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 - 没有标题的Powershell export-csv?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26389952/

相关文章:

c# - 启动服务未返回有关失败的足够信息

powershell - 通过 powershell 脚本将 Dacpac 包部署到 Azure SQL Server

python - 使用 pydub 导出时出错 - 如何为 pydub 安装 mp3 编解码器?

office365 - 如何在两个 o365 租户之间建立信任

sharepoint - 由 JavaScript 调用的 Azure Active Directory 保护的 WebApi

powershell - 为什么 Powershell 可以访问较新的 .net 版本中引入的方法?

web-services - 获取 SharePoint 文档库级别的安全用户 PowerShell

R:多个模型并排的方差分析输出

excel - 使用查找表中的值导出 Access 数据库

ms-office - 从 Outlook JavaScript Api (office.js) 调用时,Exchange EWS 的 UpdateItem 中的访问被拒绝