Hi fellow Powershellers,
I am a newbee to PS. Reading “powershell in a month of lunches”. I am trying to determine a way to export values with a wide column, to a csv, and not have PS truncate a wide value. I have read the help files and have tried numerous basic (non-vb script approach) solutions - none doing what I want.
I want to be able to dump something and send it out to an csv - simple and I can do that but when one of my columns is quite large, it will truncate the output (…). Here is an example which is “similar” to one of the book labs.
dir ‘C:\Windows*.exe’ | Format-Table name, @{name=‘Size’;expression={$_.length}}, versioninfo | out-file .\myfile2.csv
Now of course the above is a table output and the versioninfo field is huge. It stays truncate when I send it out to CSV. -autosize and -wrap do not suffice.
When I run below using a list. Yes, it works but I do not want a list format. I want a simple column format:
dir ‘C:\Windows*.exe’ | Format-List name, @{name=‘Size’;expression={$_.length}}, versioninfo | Out-file .\myfile.csv
I was hoping that a simple override would reformat the output and bypass the width limitations based on the screen/default formatting.
Yes, have read the help files and examples for format-table, format-list, out-file, export-csv and do not see a solution for this.
What am I missing?
Thanks MG