Format List Properties into Excel

Welcome Forums General PowerShell Q&A Format List Properties into Excel

Viewing 3 reply threads
  • Author
    Posts
    • #43828
      DB
      Participant
      Topics: 1
      Replies: 1
      Points: 0
      Rank: Member

      Hi,

      I am trying to convert some output into nice CSV files for later reference.

      E.g I am running in Office 365 Get-TransportConfig and it returns a list of properties and values. e.g.

      AddressBookPolicyRoutingEnabled : False
      AnonymousSenderToRecipientRatePerHour : 1800

      I would like to export all of these values into a CSV with the column headings:

      Property Values
      AddressBookPolicyRoutingEnabled False
      AnonymousSenderToRecipientRatePerHour 1800

      Any help would be greatly appreciated.

      Kind regards,

    • #43832
      Participant
      Topics: 37
      Replies: 143
      Points: 0
      Rank: Member

      Hi DB,

      you can use the ‘Export-CSV’ cmdlet. Simply pipe your ‘Get-TransportConfig’ cmdlet to ‘export-csv’, set the path and job done 🙂

    • #43845
      DB
      Participant
      Topics: 1
      Replies: 1
      Points: 0
      Rank: Member

      Sorry this does not work, since all the values are returned in one row, and each property is a separate column.

      I am wanting to substitute the property/value pairs into a custom table, with each on a separate row.

      I guess I could reformat the data once it is already in CSV, but out of interest I would like to know how I might be able to manipulate the output in powershell.

    • #43883
      Participant
      Topics: 37
      Replies: 143
      Points: 0
      Rank: Member

      DB,

      you can use the Export-Csv -Delimiter “,” which should separate your output. If that does not help, pop your code up and i can see how the data is being outputted.

Viewing 3 reply threads
  • The topic ‘Format List Properties into Excel’ is closed to new replies.