Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #------------------------------------------------------------------------
- # Source File Information (DO NOT MODIFY)
- # Source ID: 0e4609cd-3097-4ea6-83e1-6bfc73a5a8d9
- # Source File: ..\Documents\SAPIEN\PowerShell Studio\Files\Test_Form.psf
- #------------------------------------------------------------------------
- #region File Recovery Data (DO NOT MODIFY)
- <#RecoveryData:
- NgMAAB+LCAAAAAAABABlU8mOm1AAuyPxD6NeI5U9gJSO9PKAScIaIGyXiuUlQNgChABf35nppVJ9
- smz5Ytk7G6XthPpFisf47ZMMRdv8+sH8pH6849jb287si1vRxJVSVMiIa/TuomH8rbR9/bMbrjvi
- P/879eW/J1Z8ouLHZn++AwBNCYK/2APJq3xxoktwnkfRohv0Esq+CF76BTqqMci9u7QxyAqhmalF
- y2m9pMXmaDXkhGNupXRnDt0kn3JPcDT5SRYzInP16ZVeX0btXktacg5SeDeGsfXtUSj0PHbnPH16
- m1qOPbJtZvRww60o4Fh6m+IUeodzbHrBuj1dasWVHP30yLzL5sPx51ZdSw6M1Dm5qybPxFFGoQ2z
- t89wXFjlcJLJlzDTiCLCI475jDmTednYly7uQ3duZJI0R+MBxa4u2RPz8C6affN0BI6LwX7kVrQh
- NTYxrn7hZWrns0cvqNXKkV93E8fIgmfd2Sa1VhdcPnNEUAUa41ReGj5DP1u1te1y6qvl+bNlN+pm
- hzck3ZjvSy5sx/mA6m308aymAHY4NpZbLi+n/r7WRMBlScBFSCXDUXlChY+h1vsiFbeFypUiE8iG
- X2qFFbtddW+3epmGVw50tCP7WSxldxzj2Ei/ZY7N7Iujp2nKptb3z4A1a1lcUbgZKdhczI3q15yj
- 5ikpl7BJbPnBXpKluBJC5gcCbGgKidNHj2No7YbnAMQuJSHJCAndEyCBBCv5ruX4K9dStsIfCHXL
- Efss5SOzENv+EDURE0EtYPTMfswy5wUlvyAcy+Ftm2RBLQj7JHH7TGOss/lqLLNlVUsfiVW38kO9
- 0uMSCQBc91VyUeAZgB3xPdvvAYNhQHVSFWh4Iz6VHfHvT97/AE4KVuQ2AwAA#>
- #endregion
- <#
- .NOTES
- --------------------------------------------------------------------------------
- Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2018 v5.5.152
- Generated on: 07/22/2018 02:09
- Generated by: Alcha
- Organization: HassleFree Solutions, LLC
- --------------------------------------------------------------------------------
- .DESCRIPTION
- GUI script generated by PowerShell Studio 2018
- #>
- #----------------------------------------------
- #region Application Functions
- #----------------------------------------------
- #endregion Application Functions
- #----------------------------------------------
- # Generated Form Function
- #----------------------------------------------
- function Show-Test_Form_psf {
- #----------------------------------------------
- #region Import the Assemblies
- #----------------------------------------------
- [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
- [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
- #endregion Import Assemblies
- #----------------------------------------------
- #region Generated Form Objects
- #----------------------------------------------
- [System.Windows.Forms.Application]::EnableVisualStyles()
- $form1 = New-Object 'System.Windows.Forms.Form'
- $buttonPressMe2 = New-Object 'System.Windows.Forms.Button'
- $buttonPressMe = New-Object 'System.Windows.Forms.Button'
- $DataTextBox = New-Object 'System.Windows.Forms.RichTextBox'
- $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'
- #endregion Generated Form Objects
- #----------------------------------------------
- # User Generated Script
- #----------------------------------------------
- $buttonPressMe_Click = {
- #TODO: Place custom script here
- $Programs = Get-Package -ProviderName Programs -IncludeWindowsInstaller
- ForEach ($Program in $Programs) {
- $DataTextBox.AppendText($Program.Name + " - " + $Program.Version + [Environment]::NewLine)
- }
- }
- $buttonPressMe2_Click={
- #TODO: Place custom script here
- $DataTextBox.Text | Out-File .\Temp.txt
- notepad .\Temp.txt
- }
- # --End User Generated Script--
- #----------------------------------------------
- #region Generated Events
- #----------------------------------------------
- $Form_StateCorrection_Load=
- {
- #Correct the initial state of the form to prevent the .Net maximized form issue
- $form1.WindowState = $InitialFormWindowState
- }
- $Form_Cleanup_FormClosed=
- {
- #Remove all event handlers from the controls
- try
- {
- $buttonPressMe2.remove_Click($buttonPressMe2_Click)
- $buttonPressMe.remove_Click($buttonPressMe_Click)
- $form1.remove_Load($Form_StateCorrection_Load)
- $form1.remove_FormClosed($Form_Cleanup_FormClosed)
- }
- catch { Out-Null <# Prevent PSScriptAnalyzer warning #> }
- }
- #endregion Generated Events
- #----------------------------------------------
- #region Generated Form Code
- #----------------------------------------------
- $form1.SuspendLayout()
- #
- # form1
- #
- $form1.Controls.Add($buttonPressMe2)
- $form1.Controls.Add($buttonPressMe)
- $form1.Controls.Add($DataTextBox)
- $form1.AutoScaleDimensions = '6, 13'
- $form1.AutoScaleMode = 'Font'
- $form1.ClientSize = '284, 135'
- $form1.Name = 'form1'
- $form1.Text = 'Form'
- #
- # buttonPressMe2
- #
- $buttonPressMe2.Anchor = 'Top, Left, Right'
- $buttonPressMe2.Location = '145, 102'
- $buttonPressMe2.Name = 'buttonPressMe2'
- $buttonPressMe2.Size = '75, 23'
- $buttonPressMe2.TabIndex = 2
- $buttonPressMe2.Text = 'Press Me 2'
- $buttonPressMe2.UseCompatibleTextRendering = $True
- $buttonPressMe2.UseVisualStyleBackColor = $True
- $buttonPressMe2.add_Click($buttonPressMe2_Click)
- #
- # buttonPressMe
- #
- $buttonPressMe.Anchor = 'Top, Left, Right'
- $buttonPressMe.Location = '64, 102'
- $buttonPressMe.Name = 'buttonPressMe'
- $buttonPressMe.Size = '75, 23'
- $buttonPressMe.TabIndex = 1
- $buttonPressMe.Text = 'Press Me'
- $buttonPressMe.UseCompatibleTextRendering = $True
- $buttonPressMe.UseVisualStyleBackColor = $True
- $buttonPressMe.add_Click($buttonPressMe_Click)
- #
- # DataTextBox
- #
- $DataTextBox.Dock = 'Top'
- $DataTextBox.Location = '0, 0'
- $DataTextBox.Name = 'DataTextBox'
- $DataTextBox.Size = '284, 96'
- $DataTextBox.TabIndex = 0
- $DataTextBox.Text = ''
- $form1.ResumeLayout()
- #endregion Generated Form Code
- #----------------------------------------------
- #Save the initial state of the form
- $InitialFormWindowState = $form1.WindowState
- #Init the OnLoad event to correct the initial state of the form
- $form1.add_Load($Form_StateCorrection_Load)
- #Clean up the control events
- $form1.add_FormClosed($Form_Cleanup_FormClosed)
- #Show the Form
- return $form1.ShowDialog()
- } #End Function
- #Call the form
- Show-Test_Form_psf | Out-Null
Add Comment
Please, Sign In to add comment