Last active
May 6, 2016 13:54
-
-
Save john-clark/dcff131005ff109bc63887cc94ca9f35 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Lets make this better looking | |
# | |
function GenerateForm { | |
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null | |
[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null | |
$form1 = New-Object System.Windows.Forms.Form | |
$dataGridView1 = New-Object System.Windows.Forms.DataGridView | |
$InitialFormWindowState = New-Object System.Windows.Forms.FormWindowState | |
$System_Drawing_Size = New-Object System.Drawing.Size | |
$System_Drawing_Size.Height = 386 | |
$System_Drawing_Size.Width = 762 | |
$form1.ClientSize = $System_Drawing_Size | |
$form1.DataBindings.DefaultDataSourceUpdateMode = 0 | |
$form1.Name = "form1" | |
$form1.Text = "Steam Apps" | |
$dataGridView1.DataBindings.DefaultDataSourceUpdateMode = 0 | |
$System_Drawing_Point = New-Object System.Drawing.Point | |
$System_Drawing_Point.X = 12 | |
$System_Drawing_Point.Y = 12 | |
$dataGridView1.Location = $System_Drawing_Point | |
$dataGridView1.Name = "dataGridView1" | |
$System_Drawing_Size = New-Object System.Drawing.Size | |
$System_Drawing_Size.Height = 362 | |
$System_Drawing_Size.Width = 738 | |
$dataGridView1.Size = $System_Drawing_Size | |
$dataGridView1.TabIndex = 0 | |
$dataArray= new-object System.Collections.ArrayList | |
$dataArray.AddRange( @( get-childitem "C:\Program Files (x86)\Steam\steamapps" -Filter *.acf | Foreach-Object { (Get-Content $_.FullName -raw) -replace "`"`t`t","`":`t`t" -replace "`"AppState`"`n{","{" -replace "`"`n`t{","`": [{" -replace "`t}","`t}]," -replace "`"`n","`",`n" -replace "`",`n`t}],","`"`n`t}]," -replace "}],`n}","}]`n}" | convertfrom-json } | Write-Output )) | |
$dataGridView1.DataSource = $dataArray | |
$DataGridView1.Dock = "fill" | |
$DataGridView1.AllowUsertoResizeColumns=$True | |
$form1.Controls.Add($dataGridView1) | |
$InitialFormWindowState = $form1.WindowState | |
$form1.add_Load($OnLoadForm_StateCorrection) | |
$form1.ShowDialog()| Out-Null | |
} | |
GenerateForm | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment