![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | How export-csv deals with string versus string[] An interesting question came up regarding Exchange 2007. One of the cmdlets returns properties that are a simply system.string, while some other properties are system.string[]. [PS] C:\Documents and Settings\Administrator>Get-MessageTrackingLog|select-object recipients|export-csv c:\test.csv [PS] C:\Documents and Settings\Administrator>gc c:\test.csv #TYPE System.Management.Automation.PSCustomObject Recipients System.String[] System.String[] System.String[] [PS] C:\Documents and Settings\Administrator>Get-MessageTrackingLog|select-object sender|export-csv c:\test.csv [PS] C:\Documents and Settings\Administrator>gc c:\test.csv #TYPE System.Management.Automation.PSCustomObject Sender Administrator@contoso.com Administrator@contoso.com Administrator@contoso.com [PS] C:\Documents and Settings\Administrator> Anyone had any idea how one can expand a system.string[] to it is properly listed out with export-csv? Is this a bug? Marco |
My System Specs![]() |
| | #2 (permalink) |
| | RE: How export-csv deals with string versus string[] can you try this : Get-MessageTrackingLog|select-object {$_.recipients} | export-csv c:\test.csv soory can't test here but think that should work . Greetings /\/\o\/\/ "Marco Shaw" wrote: > An interesting question came up regarding Exchange 2007. One of the > cmdlets returns properties that are a simply system.string, while some > other properties are system.string[]. > > [PS] C:\Documents and > Settings\Administrator>Get-MessageTrackingLog|select-object > recipients|export-csv c:\test.csv > [PS] C:\Documents and Settings\Administrator>gc c:\test.csv > #TYPE System.Management.Automation.PSCustomObject > Recipients > System.String[] > System.String[] > System.String[] > [PS] C:\Documents and > Settings\Administrator>Get-MessageTrackingLog|select-object > sender|export-csv c:\test.csv > [PS] C:\Documents and Settings\Administrator>gc c:\test.csv > #TYPE System.Management.Automation.PSCustomObject > Sender > Administrator@contoso.com > Administrator@contoso.com > Administrator@contoso.com > [PS] C:\Documents and Settings\Administrator> > > Anyone had any idea how one can expand a system.string[] to it is > properly listed out with export-csv? > > Is this a bug? > > Marco > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: How export-csv deals with string versus string[] //o// [MVP] wrote: > can you try this : > > Get-MessageTrackingLog|select-object {$_.recipients} | export-csv c:\test.csv > > soory can't test here but think that should work . It works! Thought I had tried that, but guess I didn't... I did this instead to retain the header title: Get-MessageTrackingLog|select-object @{Name="Recipients";Expression={$_.recipients}} | export-csv c:\test.csv Thanks! Marco |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Find a string within a variable string | PowerShell | |||
| problems with $var | select-string -pattern $string -q | PowerShell | |||
| Search for string in CSV and delete line if string found in line | PowerShell | |||
| String PRODUCT_NAME was not found in string table | Vista General | |||