\n Hi, and welcome to the PowerShell forum! \n\n\nDon’t apologize for being a “noob” or “newbie” or “n00b.” There’s just no need – nobody will think you’re stupid, and the forums are all about asking questions. Just ask! \n\n\nUse a descriptive subject. Don’t say “Need help” or “PowerShell Help”, actually summarize what the problem is. It helps the rest of us keep track of which problem is which. \n\n\nDon’t post massive scripts. We’re all volunteers and we don’t have time to read all that, nor will we copy…\n <\/blockquote>\n<\/aside>\n\n <\/p>","upvoteCount":0,"datePublished":"2018-06-29T14:34:20.000Z","url":"https://community.spiceworks.com/t/trouble-exporting-csv-with-powershell/659572/2","author":{"@type":"Person","name":"Neally","url":"https://community.spiceworks.com/u/Neally"}},{"@type":"Answer","text":"
Can you show is what you want the CSV to look like in the end?<\/p>\n
You just want to append the columns?<\/p>","upvoteCount":0,"datePublished":"2018-06-29T14:38:49.000Z","url":"https://community.spiceworks.com/t/trouble-exporting-csv-with-powershell/659572/3","author":{"@type":"Person","name":"Neally","url":"https://community.spiceworks.com/u/Neally"}},{"@type":"Answer","text":"
Thanks! Will do next time!<\/p>","upvoteCount":0,"datePublished":"2018-06-29T15:22:10.000Z","url":"https://community.spiceworks.com/t/trouble-exporting-csv-with-powershell/659572/4","author":{"@type":"Person","name":"vishalkrishnaswamy","url":"https://community.spiceworks.com/u/vishalkrishnaswamy"}},{"@type":"Answer","text":"
I figured out how to format it correctly by using calculated properties!<\/p>","upvoteCount":0,"datePublished":"2018-06-29T15:26:27.000Z","url":"https://community.spiceworks.com/t/trouble-exporting-csv-with-powershell/659572/6","author":{"@type":"Person","name":"vishalkrishnaswamy","url":"https://community.spiceworks.com/u/vishalkrishnaswamy"}},{"@type":"Answer","text":"
The problem was that the way I was pulling the data for the csv initially grouped all of the properties under one header.<\/p>","upvoteCount":0,"datePublished":"2018-06-29T15:27:36.000Z","url":"https://community.spiceworks.com/t/trouble-exporting-csv-with-powershell/659572/7","author":{"@type":"Person","name":"vishalkrishnaswamy","url":"https://community.spiceworks.com/u/vishalkrishnaswamy"}},{"@type":"Answer","text":"\n\n
<\/div>\n
VishaI:<\/div>\n
\nI figured out how to format it correctly by using calculated properties!<\/p>\n<\/blockquote>\n<\/aside>\n
oh ok so you just used select-object<\/p>\n
$data | \nselect displayname,\n@{n='something';e={'somevalue'}}\n<\/code><\/pre>","upvoteCount":0,"datePublished":"2018-06-29T15:28:41.000Z","url":"https://community.spiceworks.com/t/trouble-exporting-csv-with-powershell/659572/8","author":{"@type":"Person","name":"Neally","url":"https://community.spiceworks.com/u/Neally"}},{"@type":"Answer","text":"\n\n
<\/div>\n
VishaI:<\/div>\n
\nThe problem was that the way I was pulling the data for the csv initially grouped all of the properties under one header.<\/p>\n<\/blockquote>\n<\/aside>\n
You did not mention that, giving an example of what the output looks like helps :¬)<\/p>\n
Glad you got it figured out.<\/p>","upvoteCount":1,"datePublished":"2018-06-29T15:29:56.000Z","url":"https://community.spiceworks.com/t/trouble-exporting-csv-with-powershell/659572/9","author":{"@type":"Person","name":"Neally","url":"https://community.spiceworks.com/u/Neally"}},{"@type":"Answer","text":"
Looks like you ran<\/p>\n
import-csv \"$env:USERPROFILE\\desktop\\in.csv\"|select userprincipalname,displayname|export-csv $env:USERPROFILE\\desktop\\nest.csv -notype\n\n<\/code><\/pre>","upvoteCount":0,"datePublished":"2018-06-29T17:42:45.000Z","url":"https://community.spiceworks.com/t/trouble-exporting-csv-with-powershell/659572/10","author":{"@type":"Person","name":"jitensh","url":"https://community.spiceworks.com/u/jitensh"}}]}}
Neally
(Neally)
June 29, 2018, 2:34pm
2
Welcome!
If you post code, please use the ‘Insert Code’ button. Please and thank you!
Hi, and welcome to the PowerShell forum!
Don’t apologize for being a “noob” or “newbie” or “n00b.” There’s just no need – nobody will think you’re stupid, and the forums are all about asking questions. Just ask!
Use a descriptive subject. Don’t say “Need help” or “PowerShell Help”, actually summarize what the problem is. It helps the rest of us keep track of which problem is which.
Don’t post massive scripts. We’re all volunteers and we don’t have time to read all that, nor will we copy…