Advertisement
Guest User

powershellscript

a guest
Jun 22nd, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function writemessage($input) {
  2. $wshell = New-Object -ComObject Wscript.Shell
  3.  
  4. $wshell.Popup($input,0,"Done",0x1)
  5.  
  6. }
  7.  
  8. Add-Type -AssemblyName System.Windows.Forms
  9.  
  10. $Form = New-Object system.Windows.Forms.Form
  11. $Form.Text = "Form"
  12. $Form.TopMost = $true
  13. $Form.Width = 356
  14. $Form.Height = 244
  15. $Form.StartPosition = "CenterScreen"
  16.  
  17. $textBox2 = New-Object system.windows.Forms.TextBox
  18. $textBox2.Width = 100
  19. $textBox2.Height = 20
  20. $textBox2.location = new-object system.drawing.point(10,20)
  21. $textBox2.Font = "Microsoft Sans Serif,10"
  22. $Form.controls.Add($textBox2)
  23.  
  24. [String]$variable
  25.  
  26. $button4 = New-Object system.windows.Forms.Button
  27. $button4.Text = "button"
  28. $button4.Width = 60
  29. $button4.Height = 30
  30. $button4.Add_Click({
  31.     $variable = "second"
  32.     writemessage $variable
  33.  
  34. })
  35.  
  36. $button4.Click
  37. $button4.location = new-object system.drawing.point(55,75)
  38. $button4.Font = "Microsoft Sans Serif,10"
  39. $Form.controls.Add($button4)
  40.  
  41.  
  42.  
  43.  
  44. [void]$Form.ShowDialog($variable)
  45. $Form.Dispose()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement