Output to Comma Delimited File

Welcome Forums General PowerShell Q&A Output to Comma Delimited File

Viewing 3 reply threads
  • Author
    Posts
    • #156707
      Participant
      Topics: 21
      Replies: 41
      Points: 303
      Rank: Contributor

      Hello,

      I have the following script to output member of an AD group:

      The output is displayed as tab delimited.  I’d like to make it comma delimited.

      Any suggestions?

      Thanks,

      Frank

    • #156711
      Participant
      Topics: 7
      Replies: 2458
      Points: 6,439
      Helping Hand
      Rank: Community MVP

      That’s anyway just the output of the console. If you want to have it in a file you should use Export-Csv. Please read the complete help including the examples to learn how to use it.

      • #156878
        Participant
        Topics: 21
        Replies: 41
        Points: 303
        Rank: Contributor

        Yep, that was what I was looking for.

        Here’s what I have:

         

        Thanks for your help!

    • #156723
      Participant
      Topics: 0
      Replies: 36
      Points: 408
      Helping Hand
      Rank: Contributor

      You should be able to use -join for this. You’ll want to decide what property you want delimited. I chose Name.

    • #156741
      Participant
      Topics: 2
      Replies: 513
      Points: 1,322
      Helping Hand
      Rank: Community Hero

      It sounds like you’re asking for a CSV file, in which case Olaf’s suggestion is one of the most effective. Also worth noting that if you don’t want to create a file and just want to convert it to CSV in the console there is also a ConvertTo-Csv cmdlet. 🙂

Viewing 3 reply threads
  • The topic ‘Output to Comma Delimited File’ is closed to new replies.