Powershell Format-Table to CSV

devfunkd

I have the following line in Powershell to output an array of data. The problem I am having is that Name,Title,Department do not go into columns. Instead I get a single column with each row in a single cell with tabs between.

$outList | Format-Table Name,Title,Department -auto >c:\Scripts\test2.csv

How can I output into columns?

MFT

You should be using the Export-Csv cmdlet instead.

$outList | Export-Csv -path c:\scripts\test.csv -NoTypeInformation

If you need only selected fields, pipe it into a Select-Object cmdlet first.

$outList | Select-Object -Property Name, Title, Department | Export-Csv -path c:\scripts\test.csv -NoTypeInformation

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Powershell and format-table

From Dev

Convert date format in csv by powershell

From Dev

How can I display format-table powershell data imported from csv with an if statement?

From Dev

Sort table with Format-Table in Powershell

From Dev

Converting below txt table to csv table format

From Dev

Change date format in CSV using PowerShell

From Dev

Powershell - amend date format to values in CSV column

From Dev

How to colorise PowerShell output of Format-Table

From Dev

Powershell Loop through Format-Table

From Dev

How to colorise PowerShell output of Format-Table

From Dev

Powershell msword table format cell text

From Dev

Powershell Loop through Format-Table

From Dev

Efficiently ploting a table in csv format using Python

From Dev

Export SQL table to CSV format with PHP

From Dev

Write java bean to Csv Table format

From Dev

How to format PowerShell multidimensional array with Format-Table

From Dev

Export nested hash table to csv in powershell

From Dev

Powershell Software Audit Output -csv format separated columns

From Dev

how to format data acquired using powershell import-csv

From Dev

Change date format in PowerShell Export SQL to CSV script

From Dev

How do I create an alias to Format-Table in Powershell?

From Dev

What's the maximum number of columns for Format-Table cmdlet in PowerShell

From Dev

Format the output of a hash table in Powershell to output to one line

From Dev

Powershell Out-Printer breaks Format-Table column layout

From Dev

Format the output of a hash table in Powershell to output to one line

From Dev

What's the maximum number of columns for Format-Table cmdlet in PowerShell

From Dev

Powershell - Prefix each line of Format-Table with String

From Dev

Align Format-Table output in powershell after converting to string

From Dev

Creating structured hive table with unstructured GPS packets in csv format

Related Related

  1. 1

    Powershell and format-table

  2. 2

    Convert date format in csv by powershell

  3. 3

    How can I display format-table powershell data imported from csv with an if statement?

  4. 4

    Sort table with Format-Table in Powershell

  5. 5

    Converting below txt table to csv table format

  6. 6

    Change date format in CSV using PowerShell

  7. 7

    Powershell - amend date format to values in CSV column

  8. 8

    How to colorise PowerShell output of Format-Table

  9. 9

    Powershell Loop through Format-Table

  10. 10

    How to colorise PowerShell output of Format-Table

  11. 11

    Powershell msword table format cell text

  12. 12

    Powershell Loop through Format-Table

  13. 13

    Efficiently ploting a table in csv format using Python

  14. 14

    Export SQL table to CSV format with PHP

  15. 15

    Write java bean to Csv Table format

  16. 16

    How to format PowerShell multidimensional array with Format-Table

  17. 17

    Export nested hash table to csv in powershell

  18. 18

    Powershell Software Audit Output -csv format separated columns

  19. 19

    how to format data acquired using powershell import-csv

  20. 20

    Change date format in PowerShell Export SQL to CSV script

  21. 21

    How do I create an alias to Format-Table in Powershell?

  22. 22

    What's the maximum number of columns for Format-Table cmdlet in PowerShell

  23. 23

    Format the output of a hash table in Powershell to output to one line

  24. 24

    Powershell Out-Printer breaks Format-Table column layout

  25. 25

    Format the output of a hash table in Powershell to output to one line

  26. 26

    What's the maximum number of columns for Format-Table cmdlet in PowerShell

  27. 27

    Powershell - Prefix each line of Format-Table with String

  28. 28

    Align Format-Table output in powershell after converting to string

  29. 29

    Creating structured hive table with unstructured GPS packets in csv format

HotTag

Archive