Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Custom object and its property displays uneven when trying format-table or exporting to csv

$
0
0

So what I'm trying to do here is to export a csv file with different models of computers from dell. Here's the code

foreach($s in $strings) { if($s -like "Precision *") { $obj+= New-Object -TypeName psobject -Property @{Precision="$s"} } if($s -like "Latitude *") { $obj+= New-Object -TypeName psobject -Property @{Latitude="$s"} } }

$obj | ft -property Precision, Latitude -autosize

However, my problem is that when I later try to export or use ft to make it look clean and nice, it comes uneven. as in

Precision                            Latitude                                        
---------                            --------                                        
                                     Latitude 13 Windows 7 Driver CAB                
                                     Latitude 2100 Windows 7 Driver CAB              
                                     Latitude 2110 Windows 7 Driver CAB              
Precision M2400 Windows 7 Driver CAB                                                 
Precision M3800 Windows 7 Driver CAB                                                 
Precision M4400 Windows 7 Driver CAB                                                 

Instead I'd like it to be even, next to each other.

Home I'm clear enough of what I'm trying to do here. 



Viewing all articles
Browse latest Browse all 15028

Trending Articles