How to Display output in Powershell GUI ListViewbox as a table format?

I have tried a below code to display output in the ListViewbox. But i can't display any output in the box.

Add-Type -AssemblyName System.Windows.Forms

$Form = New-Object system.Windows.Forms.Form
$Form.Text = "Form"
$Form.TopMost = $true
$Form.Width = 696
$Form.Height = 323

$button2 = New-Object system.windows.Forms.Button
$button2.Text = "Go"
$button2.Width = 60
$button2.Height = 30
$button2.Add_Click({
      $listView3.Text = Get-Process | Out-String
})
$button2.location = new-object system.drawing.point(238,70)
$button2.Font = "Microsoft Sans Serif,10"
$Form.controls.Add($button2)

$listView3 = New-Object system.windows.Forms.ListView
$listView3.Text = "listView"
$listView3.Width = 330
$listView3.Height = 600
$listView3.location = new-object system.drawing.point(269,146)
$Form.controls.Add($listView3)

[void]$Form.ShowDialog()
$Form.Dispose()

I need to display the output in the table format in the listbox as well.. Thanks in advance....



Read more here: https://stackoverflow.com/questions/43908587/how-to-display-output-in-powershell-gui-listviewbox-as-a-table-format

Content Attribution

This content was originally published by Suganthan Raj at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: