I often format the output (in the function) as a CSV file.
When the function returns I then convert the text (ScriptOutput) with ConvertFrom-Csv
See for example Re: Invoke-VMscript (Network) - VMware Technology Network VMTN
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference