Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Turncated Issue on outfile

$
0
0

Yep. Instead of Format-Table, you would use Select-Object, and then pipe the results to Export-Csv instead of Out-File. That would allow you to use Import-Csv on the file later (or to open it with Excel.)

In this example, I've split the command into multiple lines to make it a bit easier to read:

$properties = 'FullName','CompanyName','JobTitle','FileAs','Email1Address','WebPage','IMAddress','BusinessTelephoneNumber','BusinessFaxNumber'
 
$Contacts |
Select-Object -Property $properties |
Export-Csv -NoTypeInformation -Path \\x.x.x.x.\backupemail\users\$strname\contacts\contacts.csv

Viewing all articles
Browse latest Browse all 13067

Trending Articles