Reputation: 1037
Is there a nice way to convert Collection<PSObject>
to CSV output?
Collection<PSObject> psResult = pipeline.Invoke();
Tried pipeline.ToCsv();
Also psResult.ToCsv()
Any ideas?
Upvotes: 0
Views: 904
Reputation: 174760
Add the ConvertTo-Csv
cmdlet to your pipeline
.
The Collection<PSObject>
returned will consist of comma-separated strings, easily converted to IEnumerable<string>
or string[]
Upvotes: 1