title: How to export powershell's hashtable into CSV file using Export-Csv?
body: <p>How to export powershell's hashtable into CSV file using Export-Csv ?</p>
  
  <pre><code>PS C:\&gt;$UsersAndGroups
  Name                           Value                                                                                                                                                             
  ----                           -----                                                                                                                                                             
  user1                          {Group2}                                                                                                                    
  user2                          {Group1, Group2, Group3}                                                                                                                                   
  user3                          {Group3, Group4}     
  </code></pre>
  
  <p>I want to get this into CSV file where each key-value pair is in new line. First column should allways be key and next columns should be values.   </p>
  
  <p>Like this:</p>
  
  <pre><code>|col1    col2    col3    col4   
   +------------------------------  
  1|User1  Group2  
  2|User2  Group1  Group2  Group3 
  3|User3  Group3  Group4
  </code></pre>
  
  <p>Thank you very much.</p>