Guest User

Untitled

a guest
Jul 22nd, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.00 KB | None | 0 0
  1. #------------------------------------------------------------------------
  2. # Source File Information (DO NOT MODIFY)
  3. # Source ID: 0e4609cd-3097-4ea6-83e1-6bfc73a5a8d9
  4. # Source File: ..\Documents\SAPIEN\PowerShell Studio\Files\Test_Form.psf
  5. #------------------------------------------------------------------------
  6. #region File Recovery Data (DO NOT MODIFY)
  7. <#RecoveryData:
  8. NgMAAB+LCAAAAAAABABlU8mOm1AAuyPxD6NeI5U9gJSO9PKAScIaIGyXiuUlQNgChABf35nppVJ9
  9. smz5Ytk7G6XthPpFisf47ZMMRdv8+sH8pH6849jb287si1vRxJVSVMiIa/TuomH8rbR9/bMbrjvi
  10. P/879eW/J1Z8ouLHZn++AwBNCYK/2APJq3xxoktwnkfRohv0Esq+CF76BTqqMci9u7QxyAqhmalF
  11. y2m9pMXmaDXkhGNupXRnDt0kn3JPcDT5SRYzInP16ZVeX0btXktacg5SeDeGsfXtUSj0PHbnPH16
  12. m1qOPbJtZvRww60o4Fh6m+IUeodzbHrBuj1dasWVHP30yLzL5sPx51ZdSw6M1Dm5qybPxFFGoQ2z
  13. t89wXFjlcJLJlzDTiCLCI475jDmTednYly7uQ3duZJI0R+MBxa4u2RPz8C6affN0BI6LwX7kVrQh
  14. NTYxrn7hZWrns0cvqNXKkV93E8fIgmfd2Sa1VhdcPnNEUAUa41ReGj5DP1u1te1y6qvl+bNlN+pm
  15. hzck3ZjvSy5sx/mA6m308aymAHY4NpZbLi+n/r7WRMBlScBFSCXDUXlChY+h1vsiFbeFypUiE8iG
  16. X2qFFbtddW+3epmGVw50tCP7WSxldxzj2Ei/ZY7N7Iujp2nKptb3z4A1a1lcUbgZKdhczI3q15yj
  17. 5ikpl7BJbPnBXpKluBJC5gcCbGgKidNHj2No7YbnAMQuJSHJCAndEyCBBCv5ruX4K9dStsIfCHXL
  18. Efss5SOzENv+EDURE0EtYPTMfswy5wUlvyAcy+Ftm2RBLQj7JHH7TGOss/lqLLNlVUsfiVW38kO9
  19. 0uMSCQBc91VyUeAZgB3xPdvvAYNhQHVSFWh4Iz6VHfHvT97/AE4KVuQ2AwAA#>
  20. #endregion
  21.  
  22. <#
  23. .NOTES
  24. --------------------------------------------------------------------------------
  25. Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2018 v5.5.152
  26. Generated on: 07/22/2018 02:09
  27. Generated by: Alcha
  28. Organization: HassleFree Solutions, LLC
  29. --------------------------------------------------------------------------------
  30. .DESCRIPTION
  31. GUI script generated by PowerShell Studio 2018
  32. #>
  33.  
  34.  
  35. #----------------------------------------------
  36. #region Application Functions
  37. #----------------------------------------------
  38.  
  39. #endregion Application Functions
  40.  
  41. #----------------------------------------------
  42. # Generated Form Function
  43. #----------------------------------------------
  44. function Show-Test_Form_psf {
  45.  
  46. #----------------------------------------------
  47. #region Import the Assemblies
  48. #----------------------------------------------
  49. [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
  50. [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
  51. #endregion Import Assemblies
  52.  
  53. #----------------------------------------------
  54. #region Generated Form Objects
  55. #----------------------------------------------
  56. [System.Windows.Forms.Application]::EnableVisualStyles()
  57. $form1 = New-Object 'System.Windows.Forms.Form'
  58. $buttonPressMe2 = New-Object 'System.Windows.Forms.Button'
  59. $buttonPressMe = New-Object 'System.Windows.Forms.Button'
  60. $DataTextBox = New-Object 'System.Windows.Forms.RichTextBox'
  61. $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'
  62. #endregion Generated Form Objects
  63.  
  64. #----------------------------------------------
  65. # User Generated Script
  66. #----------------------------------------------
  67. $buttonPressMe_Click = {
  68. #TODO: Place custom script here
  69. $Programs = Get-Package -ProviderName Programs -IncludeWindowsInstaller
  70. ForEach ($Program in $Programs) {
  71. $DataTextBox.AppendText($Program.Name + " - " + $Program.Version + [Environment]::NewLine)
  72. }
  73. }
  74.  
  75. $buttonPressMe2_Click={
  76. #TODO: Place custom script here
  77. $DataTextBox.Text | Out-File .\Temp.txt
  78. notepad .\Temp.txt
  79. }
  80.  
  81. # --End User Generated Script--
  82. #----------------------------------------------
  83. #region Generated Events
  84. #----------------------------------------------
  85.  
  86. $Form_StateCorrection_Load=
  87. {
  88. #Correct the initial state of the form to prevent the .Net maximized form issue
  89. $form1.WindowState = $InitialFormWindowState
  90. }
  91.  
  92. $Form_Cleanup_FormClosed=
  93. {
  94. #Remove all event handlers from the controls
  95. try
  96. {
  97. $buttonPressMe2.remove_Click($buttonPressMe2_Click)
  98. $buttonPressMe.remove_Click($buttonPressMe_Click)
  99. $form1.remove_Load($Form_StateCorrection_Load)
  100. $form1.remove_FormClosed($Form_Cleanup_FormClosed)
  101. }
  102. catch { Out-Null <# Prevent PSScriptAnalyzer warning #> }
  103. }
  104. #endregion Generated Events
  105.  
  106. #----------------------------------------------
  107. #region Generated Form Code
  108. #----------------------------------------------
  109. $form1.SuspendLayout()
  110. #
  111. # form1
  112. #
  113. $form1.Controls.Add($buttonPressMe2)
  114. $form1.Controls.Add($buttonPressMe)
  115. $form1.Controls.Add($DataTextBox)
  116. $form1.AutoScaleDimensions = '6, 13'
  117. $form1.AutoScaleMode = 'Font'
  118. $form1.ClientSize = '284, 135'
  119. $form1.Name = 'form1'
  120. $form1.Text = 'Form'
  121. #
  122. # buttonPressMe2
  123. #
  124. $buttonPressMe2.Anchor = 'Top, Left, Right'
  125. $buttonPressMe2.Location = '145, 102'
  126. $buttonPressMe2.Name = 'buttonPressMe2'
  127. $buttonPressMe2.Size = '75, 23'
  128. $buttonPressMe2.TabIndex = 2
  129. $buttonPressMe2.Text = 'Press Me 2'
  130. $buttonPressMe2.UseCompatibleTextRendering = $True
  131. $buttonPressMe2.UseVisualStyleBackColor = $True
  132. $buttonPressMe2.add_Click($buttonPressMe2_Click)
  133. #
  134. # buttonPressMe
  135. #
  136. $buttonPressMe.Anchor = 'Top, Left, Right'
  137. $buttonPressMe.Location = '64, 102'
  138. $buttonPressMe.Name = 'buttonPressMe'
  139. $buttonPressMe.Size = '75, 23'
  140. $buttonPressMe.TabIndex = 1
  141. $buttonPressMe.Text = 'Press Me'
  142. $buttonPressMe.UseCompatibleTextRendering = $True
  143. $buttonPressMe.UseVisualStyleBackColor = $True
  144. $buttonPressMe.add_Click($buttonPressMe_Click)
  145. #
  146. # DataTextBox
  147. #
  148. $DataTextBox.Dock = 'Top'
  149. $DataTextBox.Location = '0, 0'
  150. $DataTextBox.Name = 'DataTextBox'
  151. $DataTextBox.Size = '284, 96'
  152. $DataTextBox.TabIndex = 0
  153. $DataTextBox.Text = ''
  154. $form1.ResumeLayout()
  155. #endregion Generated Form Code
  156.  
  157. #----------------------------------------------
  158.  
  159. #Save the initial state of the form
  160. $InitialFormWindowState = $form1.WindowState
  161. #Init the OnLoad event to correct the initial state of the form
  162. $form1.add_Load($Form_StateCorrection_Load)
  163. #Clean up the control events
  164. $form1.add_FormClosed($Form_Cleanup_FormClosed)
  165. #Show the Form
  166. return $form1.ShowDialog()
  167.  
  168. } #End Function
  169.  
  170. #Call the form
  171. Show-Test_Form_psf | Out-Null
Add Comment
Please, Sign In to add comment