[reflection.assembly]::LoadWithPartialName("System.Windows.Forms") [reflection.assembly]::LoadWithPartialName("System.Drawing") $myBrush= new-object Drawing.SolidBrush green $myPen= New-Object Drawing.Pen black $rect=New-Object Drawing.Rectangle 10, 10, 180, 180 $form=New-Object Windows.Forms.Form $formGraphics=$form.CreateGraphics() $form.add_paint({ $formGraphics.FillEllipse($myBrush, $rect) $mypen.color="red" $mypen.width=5 $formGraphics.DrawLine($myPen, 10, 10, 190, 190) $formGraphics.DrawLine($myPen, 10, 10, 10, 190) }) $form.ShowDialog()