title: Output Serial Number and MAC address on CSV file using powershell with 2 columns
body: <p>I want to save the serial number and the MAC address of each machine to a CSV file. I will use a USB drive to run the powershell file on each computers and save it on a CSV file. I use the script below:</p>
  
  <p>$MAC = Get-NetAdapter -Name "Ethernet"</p>
  
  <p>$serial = (Get-WmiObject Win32_Bios).SerialNumber</p>
  
  <p>$dir = Set-Content "$location" -Value "Serial Number,MAC Address"</p>
  
  <p>$dir</p>
  
  <p>$location = "C:\Users\Frangon\Desktop\$env:COMPUTERNAME.csv"</p>
  
  <p>Add-Content $location $serial</p>
  
  <p>Add-Content $location $MAC.MacAddress</p>
  
  <p>The result is this:</p>
  
  <p><a href="https://i.stack.imgur.com/lFstN.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>I want the MAC address to be on the MAC address column and vice versa.</p>
  
  <p><a href="https://i.stack.imgur.com/lFstN.png" rel="nofollow noreferrer">This is the result of my noob script</a></p>