Powershell export-csv with no headers?

后端 未结 1 1925
小鲜肉
小鲜肉 2020-12-17 10:10

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

Here is my current code:

Get-Mailbox -Re         


        
相关标签:
1条回答
  • 2020-12-17 11:12

    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"
    

    Edit: 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"
    
    0 讨论(0)
提交回复
热议问题