title: Output single line of multi-line CimInstance
body: <p>I am trying to find a full solution to capture information from with <code>Get-CimInstance Win32_NetworkAdapter</code> and save it to a table on a server. Currently I am using the code around below: </p>
  
  <pre><code>$SerialNum = Get-CIMInstance WIN32_BIOS | SELECT -ExpandProperty SerialNumber 
  Get-CimInstance Win32_NetworkAdapter | Select-Object * |
   Export-Csv S:\$SerialNum-NetAdptr.csv -Force -NoTypeInformation
    Import-Csv S:\$SerialNum-NetAdptr.csv |
     Select-Object *, @{Name='Serial';Expression={Get-CIMInstance WIN32_BIOS | Select-Object -ExpandProperty SerialNumber}} |
      Export-Csv S:\$SerialNum-NetAdptrSerialized.csv -Force -NoTypeInformation
       Remove-Item S:\$SerialNum-NetAdptr.csv 
  </code></pre>
  
  <p>The issue I am having is computers with multiple NICs output multiple lines so outputting like:</p>
  
  <pre><code>$NetAdptrINF = Get-CIMInstance Win32_NetworkAdapter | Select-Object *
  $objRecordSet.Fields.Item("ProductName").Value = ($NetAdptrINF.ProductName).ToString()
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$objRecordSet.Fields.Item("ProductName").Value = $NetAdptrINF.ProductName
  </code></pre>
  
  <p>Saves something along the lines of: <code>System[].object</code> in the field. I have been looking at using foreach to print one line of each network adapter property at a time but have been unable to get anything that even remotely works. I am using PowerShell bundled in Windows 10 ADK.</p>
  
  <p><code>$NetAdptrInf.ProductName</code> outputs:</p>
  
  <p><code>Microsoft Kernel Debug Network Adapter
  Intel(R) Dual Band Wireless-AC 7260
  Intel(R) Ethernet Connection I217-LM
  Microsoft Wi-Fi Direct Virtual Adapter
  Microsoft Hosted Network Virtual Adapter
  Microsoft ISATAP Adapter
  Microsoft Teredo Tunneling Adapter
  Microsoft ISATAP Adapter
  Microsoft ISATAP Adapter
  VirtualBox Host-Only Ethernet Adapter</code></p>
  
  <p>I need to be able to output one <code>ProductName</code> save it to a record along with other information collected from Win32_NetworkAdapter then move to the next one and repeat. </p>
  
  <p>Thank you.</p>