Italian (IT)

Use .NET in PowerShell script

[void][reflection.assembly]::LoadWithPartialName("System.Windows.Forms")
$form = New-Object Windows.Forms.Form
$form.Text = "My first form"
$button = New-Object Windows.Forms.Button
$button.text="Click here!"
$button.Dock="fill"
$button.add_click({$form.close()})
$form.controls.add($button)
$form.Add_Shown({$form.Activate()})
$form.ShowDialog()

 


© 2017 Bruno Tessaro. My life in the web. All right reserved.

This website uses cookies to ensure you get the best experience on our website.