I am trying to export an array of multi-value properties to a CSV file but I am getting only a series of semi-columns using the following PowerShell code.
$machines | computerDnsName, @{name="ipAddresses";expression={$_.ipAddresses -join ";"}} | Export-Csv filename.csv -NoTypeInformation
This PowerShell code works with single multi-valued property such as an email address (i.e., multiple email addresses for a user). However, it doesn't work for the multi-value field that contains another multi-value field such as listed below.
The multi-value properties that I am trying to extract and write to CSV file look like the following
IpAddresses: {@{ipAddress=192.168.100.234; macAddress=B8EE65E45DCF; type=Other; operationalStatus=Up}, @{ipAddress=fe80::2f7a:3d3:7e2b:15f1; macAddress=B8EE65E45DCF; type=Other;
operationalStatus=Up}, @{ipAddress=127.0.0.1; macAddress=000000000000; type=Other; operationalStatus=Up}, @{ipAddress=::1; macAddress=000000000000; type=Other;
operationalStatus=Up}}
How can I extract these fields to CSV?
Thank you in advance