Author Posts

June 27, 2016 at 10:58 am

I have a number of server scan results in a custom object properties like some file paths, local groups. Problem is when I try to export to csv some note properties e.g. file paths get cut and my local groups get only first line in the csv. As an example I have a Custom Object called $report with note properties scheduled_task_action C:\Program Files\ABC\test.exe C:\Program Files\ABC\test.xml where after exporting to csv I see only C:\Program Files\A
or in my local_admins list property :
adminsitartor;
domain\user1;
domain\user2,
...
I only get administrator. All the note properties are strings. I export with
$report | select scheduled_task_action, local_admins | Export-CSV .\test.csv -force -encoding UTF8 -NoTypeInformation
How can this be fixed so the whole properties show up when I open the csv in Execl?

June 27, 2016 at 11:19 am

Depends on what's in the objects you're exporting to a CSV. Also, in Excel, you may need to change your column height / row width in order to see all of the information that's available in each cell.

June 27, 2016 at 11:34 am

You're right. I incorrectly assumed that export-csv will add comas where needed yet looking at the resulting csv in notepad it seems it's not the case so need to sort out my formatting.
I noticed that for some reason in the resulting csv I get end of line followed by "," in the line below which messes up the csv
e.g.
"scheduled_task_action","c:\test.exe c:\test.xml
","scheduled_task_name"
","....
what coule be the reason for that?

  • This reply was modified 2 years, 2 months ago by  YCE.