title: Adding to a CSV File in PowerShell
body: <p>I'm working on a project where I have to make and append a CSV file but I'm not getting the content to save to the file.
  The exact instructions are:</p>
  <p><strong>Using functions, create a loop to get data from user
  Name
  Address
  City
  State
  Zip
  Phone
  Store that data in a text file, appending to the end of the file
  Loop should have an option to quit before entering next set of data
  The file should
  Be in CSV format
  Have a header line</strong></p>
  <p>so far what I have is</p>
  <pre><code>
  cls
  
  $csvPath = 'D:\Users\zabin\OneDrive\Desktop\ITS3410\WEEK7\List.csv'
  Add-Content -path D:\Users\zabin\OneDrive\Desktop\ITS3410\WEEK7\List.csv -Value '&quot;Name&quot;,&quot;Address&quot;,&quot;City&quot;,&quot;State&quot;,&quot;Zip&quot;,&quot;Phone&quot;'
  
  do{
  $list = @(
  
  $Name = Read-host 'Enter Your Name' 
  
  $Address = Read-host 'Enter Your Address'
  
  $City = Read-host 'Enter Your City'
  
  $State = Read-host 'Enter Your State'
  
  $Zip = Read-host 'Enter Your Zip'
  
  $Phone = Read-host 'Enter Your Phone Number'
  )
  
  $Quit = Read-host 'Press &quot;q&quot; to exit'
  
  
  
  $list | ForEach-Object  {
       $objResults = New-Object PSObject -Property @{
          Name    = $Name
          Address = $Address
          City    = $City
          State  = $State
          Zip    = $Zip
          Phone  = $Phone
     
      }
      $objResults | Export-Csv -NoTypeInformation $csvPath -append 
  }
  
  
  
  }
  while($quit -ne 'q') 
  </code></pre>
  <p>Any advice?</p>