1 2 3 4 5 6 7 8 9 |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") $mypen = new-object Drawing.Pen red $mypen.width = 10 $form = New-Object Windows.Forms.Form $formGraphics = $form.createGraphics() $form.add_paint({$formGraphics.DrawLine($mypen, 10, 10, 200, 200)}) $form.ShowDialog() |