[powershell] Pomoc

Viewer

  1. <# This form was created using POSHGUI.com  a free online gui designer for PowerShell
  2. .NAME
  3.     Untitled
  4. #>
  5.  
  6.  
  7. Add-Type -AssemblyName System.Windows.Forms
  8. [System.Windows.Forms.Application]::EnableVisualStyles()
  9.  
  10. $Form                            = New-Object system.Windows.Forms.Form
  11. $Form.ClientSize                 = New-Object System.Drawing.Point(720,590)
  12. $Form.text                       = "Form"
  13. $Form.TopMost                    = $false
  14. $Form.BackColor                  = [System.Drawing.ColorTranslator]::FromHtml("#f1f1f1")
  15.  
  16. $ProgressBar1                    = New-Object system.Windows.Forms.ProgressBar
  17. $ProgressBar1.width              = 647
  18. $ProgressBar1.height             = 60
  19. $ProgressBar1.location           = New-Object System.Drawing.Point(36,23)
  20.  
  21. $Start                           = New-Object system.Windows.Forms.Button
  22. $Start.text                      = "Aktualizuj"
  23. $Start.width                     = 93
  24. $Start.height                    = 45
  25. $Start.location                  = New-Object System.Drawing.Point(590,524)
  26. $Start.Font                      = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
  27.  
  28. $Cancel                          = New-Object system.Windows.Forms.Button
  29. $Cancel.text                     = "Anuluj"
  30. $Cancel.width                    = 93
  31. $Cancel.height                   = 45
  32. $Cancel.location                 = New-Object System.Drawing.Point(38,524)
  33. $Cancel.Font                     = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
  34.  
  35. $TextBox1                        = New-Object system.Windows.Forms.TextBox
  36. $TextBox1.multiline              = $true
  37. $TextBox1.text                   = "Firmware"
  38. $TextBox1.width                  = 269
  39. $TextBox1.height                 = 103
  40. $TextBox1.visible                = $true
  41. $TextBox1.location               = New-Object System.Drawing.Point(37,158)
  42. $TextBox1.Font                   = New-Object System.Drawing.Font('Segoe UI',17)
  43. $TextBox1.BackColor              = [System.Drawing.ColorTranslator]::FromHtml("#f1f1f1")
  44.  
  45. $Label1                          = New-Object system.Windows.Forms.Label
  46. $Label1.text                     = "Firmware"
  47. $Label1.AutoSize                 = $true
  48. $Label1.width                    = 26
  49. $Label1.height                   = 10
  50. $Label1.location                 = New-Object System.Drawing.Point(42,118)
  51. $Label1.Font                     = New-Object System.Drawing.Font('Microsoft Sans Serif',14,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))
  52.  
  53. $PictureBox1                     = New-Object system.Windows.Forms.PictureBox
  54. $PictureBox1.width               = 198
  55. $PictureBox1.height              = 165
  56. $PictureBox1.location            = New-Object System.Drawing.Point(484,121)
  57.  
  58. $TextBox2                        = New-Object system.Windows.Forms.TextBox
  59. $TextBox2.multiline              = $true
  60. $TextBox2.width                  = 652
  61. $TextBox2.height                 = 129
  62. $TextBox2.location               = New-Object System.Drawing.Point(36,328)
  63. $TextBox2.Font                   = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
  64.  
  65. $Label2                          = New-Object system.Windows.Forms.Label
  66. $Label2.text                     = "label"
  67. $Label2.AutoSize                 = $true
  68. $Label2.width                    = 25
  69. $Label2.height                   = 10
  70. $Label2.location                 = New-Object System.Drawing.Point(130,-18)
  71. $Label2.Font                     = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
  72.  
  73. $Form.controls.AddRange(@($ProgressBar1,$Start,$Cancel,$TextBox1,$Label1,$PictureBox1,$TextBox2,$Label2))
  74.  
  75. Start-Job -Name WebRequest -ScriptBlock {
  76.   for ($i = 1$i -le 30$i++) {
  77.     Start-Sleep -Seconds 0.4
  78.     Invoke-WebRequest 'https://www.google.pl/' -TimeoutSec 5 }
  79. }
  80.  
  81. $Start.Add_Click({ Start_run })
  82. $Cancel.Add_Click({ Cancel_click })
  83.  
  84. [void]$Form.ShowDialog()
  85.  

Editor

You can edit this paste and save as new:


File Description
  • Pomoc
  • Paste Code
  • 23 Feb-2021
  • 3.85 Kb
You can Share it: