title: Powershell Listview : Add 6 items lists in 6 different columns
body: <p>I have an issue with my PS script including a listview.</p>
  <p>I need to check the content of 6 directorys and show the content in 6 different columns :</p>
  <p>The issue is that i can't get a correct visual, they are all in the same column</p>
  <p>Here is my code :</p>
  <pre><code>$Form = New-Object Windows.Forms.Form
  $Form.Text = &quot;New Test&quot;
  $Form.Width = 1550
  $Form.Height = 800 
  
  $Listview = New-Object System.Windows.Forms.ListView
  $Listview.Location = New-Object System.Drawing.Size(15,10)
  $Listview.Size = New-Object System.Drawing.Size(550,10)
  $Listview.AutoResizeColumns([System.Windows.Forms.ColumnHeaderAutoResizeStyle]::ColumnContent)
  $Listview.View = &quot;Details&quot;
  $Listview.FullRowSelect = $true
  $Listview.GridLines = $true
  $Listview.Height = 650
  $Listview.Width =1500
  $Listview.AllowColumnReorder = $true
  $Listview.Sorting = [System.Windows.Forms.SortOrder]::None  
  
  #[void]$Listview.Columns.Add('Null',0)
  [void]$Listview.Columns.Add('Scripts',150)
  [void]$Listview.Columns.Add('Applications',150)
  [void]$Listview.Columns.Add('Systems',500)
  [void]$Listview.Columns.Add('Databases',100)
  [void]$Listview.Columns.Add('Datas',150)
  [void]$Listview.Columns.Add('Backups',500)
  
  $oButton = New-Object Windows.Forms.Button
  $oButton.Text = &quot;List&quot;
  $oButton.Top = 700
  $oButton.Left = 350
  $oButton.Width = 150
  $oButton.Anchor = [System.Windows.Forms.AnchorStyles]::Bottom -bor [System.Windows.Forms.AnchorStyles]::Right 
  
  $a = (Get-ChildItem &quot;C:\Scripts\&quot;).Name
  $b = (Get-ChildItem &quot;C:\Applications\&quot;).Name
  $c = (Get-ChildItem &quot;C:\Systems\&quot;).Name
  $d = (Get-ChildItem &quot;C:\Databases\&quot;).Name
  $e = (Get-ChildItem &quot;C:\Datas\&quot;).Name
  $f = (Get-ChildItem &quot;C:\Backups\&quot;).Name
  
  
  $Entry =  New-Object System.Windows.Forms.ListViewItem($_.Null)
  
  foreach($mp in $a){
  $Entry1 = New-Object System.Windows.Forms.ListViewItem($_.Scripts)
  $Listview.Items.Add($mp)
  }
  
  foreach($mp1 in $b){
  $Entry2 = New-Object System.Windows.Forms.ListViewItem($_.Applications)
  $Listview.Items.Add($Entry2).SubItems.Add($mp1)
  }
  
  foreach($mp2 in $c){
  $Entry3 = New-Object System.Windows.Forms.ListViewItem($_.Systems)
  $Listview.Items.Add($Entry3).SubItems.Add($mp2)
  }
  
  foreach($mp3 in $d){
  $Entry4 = New-Object System.Windows.Forms.ListViewItem($_.Databases)
  $Listview.Items.Add($Entry4).SubItems.Add($mp3)
  }
  
  foreach($mp4 in $e){
  $Entry5 = New-Object System.Windows.Forms.ListViewItem($_.Datas)
  $Listview.Items.Add($Entry5).SubItems.Add($mp4)
  }
  
  
  foreach($mp5 in $f){
  $Entry6 = New-Object System.Windows.Forms.ListViewItem($_.Backup)
  $Listview.Items.Add($Entry6).SubItems.Add($mp5)
  }
  
     
  $Form.Add_Shown({$Form.Activate()}) 
    
  $Form.controls.add($oButton)
  $Form.controls.add($Listview)
    
  $Form.ShowDialog()
  </code></pre>
  <p>I tried a lot of change but im still blocked
  Thanks in advance for you help</p>
  <p>Regards</p>