I am currently trying to load a json file that is a DB into a datagridview within a form. I currnetly have the JSON file loading into an array. What I cant figure out is how to get the array to load into the datagridview so I can display the data of what is in said array from within the form.
I dont think im too far off any help would be much appreciated.
#JSON DB Front end
$jsonDB = Get-Content 'C:\Support\HardwareCollection.json' | Out-String | ConvertFrom-Json
#jsonDb has $jsonDB.Date and $jsonDB.username
$Form = New-Object system.Windows.Forms.Form
$Form.Size = New-Object System.Drawing.Size(1050,425)
$form.MaximizeBox = $false
$Form.StartPosition = "CenterScreen"
$Form.FormBorderStyle = 'Fixed3D'
$Form.Text = "Hardware Collection"
$dataGridView = New-Object System.Windows.Forms.DataGridView
$dataGridView.Size=New-Object System.Drawing.Size(500,200)
$dataGridView.Location = new-object system.drawing.size(1,150)
$dataGridView.ColumnCount = 2
$dataGridView.Columns[0].Name = "Date"
$dataGridView.Columns[1].Name = "Username"
$form.Controls.Add($dataGridView)
$datagridview.DataSource = $jsonDB
$Form.ShowDialog()
Many thanks!!!