Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Script Created By: David Septimus
- # This functionality is available directly in the Office 365 OWA.
- function Get-Mail
- {
- [cmdletbinding()]
- param(
- $UserPrincipalName,
- $Password,
- $Mailbox
- )
- [reflection.assembly]::loadwithpartialname("System.Object.Accord.Controls.ArrayDataView") | Out-Null
- $secpasswd = ConvertTo-SecureString $Password -AsPlainText -Force
- $Credential = New-Object System.Management.Automation.PSCredential ($UserPrincipalName, $secpasswd)
- [array]$Messages
- out-host -InputObject $UserPrincipalName,$Password,$Mailbox
- $MessageCount = Invoke-RestMethod -Uri "https://outlook.office365.com/api/v1.0/users('$Mailbox')/Folders/Inbox/messages?`$count" -method GET -Credential $Credential
- $array = Invoke-RestMethod -Uri "https://outlook.office365.com/api/v1.0/users('$Mailbox')/Folders/Inbox/messages" -method GET -Credential $Credential
- $MessagesPreview = New-Object System.Collections.ArrayList
- for($count = 0; $count -lt $MessageCount.value.Count; $count++){
- $messageTidbits = New-Object PSObject
- $messageTidbits | Add-Member -name Subject -Type NoteProperty -Value $array.value.subject[$count]
- $messageTidbits | Add-Member -Name Sender -Type NoteProperty -Value $array.value.sender[$count].EmailAddress.Address
- $messageTidbits | Add-Member -Name Preview -Type NoteProperty -Value $array.value.bodypreview[$count]
- $messageTidbits | Add-Member -Name ID -Type NoteProperty -Value $array.Value.ID[$count]
- $MessagesPreview.Add($messageTidbits)
- }
- $EmailList.DataSource = $MessagesPreview
- $EmailList.refresh()
- }
- #####################################
- ### Message Window
- ######################################
- #------------------------------------------------------------------------
- # Source File Information (DO NOT MODIFY)
- # Source ID: 601f787c-7ba6-4299-b8fa-2d1255fc7487
- # Source File: C:\Users\it\Documents\SAPIEN\PowerShell Studio 2014\Files\web.psf
- #------------------------------------------------------------------------
- #region File Recovery Data (DO NOT MODIFY)
- <#RecoveryData:
- vggAAB+LCAAAAAAABAC9Vl1v2jAUfZ+0/2D5GUEgBKgUIrXpKk0rGxpVu7fKSS7Mqz+Q7UCzXz8H
- BwaFNrRqUaTI174nx+fe4yThT0jlAlRxSQxBdqCpFEPcwdHnTwiFPxSdUUHYFWXwnXCIlpA053oa
- tvZWXH7yB1KDTDGHIZ4U2gBv3lGRyaVuXknF3b2BDi010G1F32165dVAcc5MrmAoIDeKsAYa5wmj
- 6TcobuQDiGHS75MgDXrtM78L3uAMI2G3MsQj0JrM4JbCEhRG6W/KMmXzcSyFUZJpJ89ueKzkHJQp
- KmDMKAgzoX8BR8Gg20B+rxO21knPgEr5ONrhrMVMDFFmLDU1VjCOYssKapIqAFGLvYFHs+FDzxF+
- WdhnVohrSTIclVVezd6Xcdhajdfp9Z27g+RC2RDUh/fPuixxVO2XurdfmkuZPlihlLG9guwnX8uU
- uPLbrXpHAEZUUJ5zZ4+OBXWOQTl7bEk6AlPjwAOeIMlXkcGjBR3K3jaDrVHObRhLPmdgINvZ3P3e
- 8hOjtJxT3HnfCc61Bm77C3qdW80UUeWXERHWsuXTm+e5kXxV/v++8Y/1jd9Opv4g6JHM73XBt5I3
- TE+ZuU6lYjR5B3e+wOL0nYLj3c9cPWP5aTgNkSJLKmZv4fL8aTDtT9vtLPCIT+q5fnF2Gk1U2QMi
- VTEBtaApvKllr1YXSwUnkVepsm8cK+0DtG1C91YJW9v/K9E/a320T74IAAA=#>
- #endregion
- <#
- .NOTES
- --------------------------------------------------------------------------------
- Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2014 v4.1.74
- Generated on: 11/14/2014 1:09 PM
- Generated by: David Septimus
- --------------------------------------------------------------------------------
- .DESCRIPTION
- GUI script generated by PowerShell Studio 2014
- #>
- #----------------------------------------------
- #region Application Functions
- #----------------------------------------------
- function Call-web_psf {
- #----------------------------------------------
- #region Import the Assemblies
- #----------------------------------------------
- [void][reflection.assembly]::Load('mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
- [void][reflection.assembly]::Load('System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
- [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
- [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
- [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
- [void][reflection.assembly]::Load('System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
- [void][reflection.assembly]::Load('System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
- [void][reflection.assembly]::Load('System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
- [void][reflection.assembly]::Load('System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
- #endregion Import Assemblies
- #----------------------------------------------
- #region Generated Form Objects
- #----------------------------------------------
- [System.Windows.Forms.Application]::EnableVisualStyles()
- $MessageViewer = New-Object 'System.Windows.Forms.Form'
- $webbrowser1 = New-Object 'System.Windows.Forms.WebBrowser'
- $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'
- #endregion Generated Form Objects
- #----------------------------------------------
- # User Generated Script
- #----------------------------------------------
- function OpenMessage($message) {
- function OnApplicationLoad {
- #Note: This function is not called in Projects
- #Note: This function runs before the form is created
- #Note: To get the script directory in the Packager use: Split-Path $hostinvocation.MyCommand.path
- #Note: To get the console output in the Packager (Windows Mode) use: $ConsoleOutput (Type: System.Collections.ArrayList)
- #Important: Form controls cannot be accessed in this function
- #TODO: Add modules and custom code to validate the application load
- return $true #return true for success or false for failure
- }
- function OnApplicationExit {
- #Note: This function is not called in Projects
- #Note: This function runs after the form is closed
- #TODO: Add custom code to clean up and unload modules when the application exits
- $script:ExitCode = 0 #Set the exit code for the Packager
- }
- #region Control Helper Functions
- function Load-DataGridView
- {
- <#
- .SYNOPSIS
- This functions helps you load items into a DataGridView.
- .DESCRIPTION
- Use this function to dynamically load items into the DataGridView control.
- .PARAMETER DataGridView
- The ComboBox control you want to add items to.
- .PARAMETER Item
- The object or objects you wish to load into the ComboBox's items collection.
- .PARAMETER DataMember
- Sets the name of the list or table in the data source for which the DataGridView is displaying data.
- #>
- Param (
- [ValidateNotNull()]
- [Parameter(Mandatory=$true)]
- [System.Windows.Forms.DataGridView]$DataGridView,
- [ValidateNotNull()]
- [Parameter(Mandatory=$true)]
- $Item,
- [Parameter(Mandatory=$false)]
- [string]$DataMember
- )
- $DataGridView.SuspendLayout()
- $DataGridView.DataMember = $DataMember
- if ($Item -is [System.ComponentModel.IListSource]`
- -or $Item -is [System.ComponentModel.IBindingList] -or $Item -is [System.ComponentModel.IBindingListView] )
- {
- $DataGridView.DataSource = $Item
- }
- else
- {
- $array = New-Object System.Collections.ArrayList
- if ($Item -is [System.Collections.IList])
- {
- $array.AddRange($Item)
- }
- else
- {
- $array.Add($Item)
- }
- $DataGridView.DataSource = $array
- }
- $DataGridView.ResumeLayout()
- }
- function ConvertTo-DataTable
- {
- <#
- .SYNOPSIS
- Converts objects into a DataTable.
- .DESCRIPTION
- Converts objects into a DataTable, which are used for DataBinding.
- .PARAMETER InputObject
- The input to convert into a DataTable.
- .PARAMETER Table
- The DataTable you wish to load the input into.
- .PARAMETER RetainColumns
- This switch tells the function to keep the DataTable's existing columns.
- .PARAMETER FilterWMIProperties
- This switch removes WMI properties that start with an underline.
- .EXAMPLE
- $DataTable = ConvertTo-DataTable -InputObject (Get-Process)
- #>
- [OutputType([System.Data.DataTable])]
- param(
- [ValidateNotNull()]
- $InputObject,
- [ValidateNotNull()]
- [System.Data.DataTable]$Table,
- [switch]$RetainColumns,
- [switch]$FilterWMIProperties)
- if($Table -eq $null)
- {
- $Table = New-Object System.Data.DataTable
- }
- if($InputObject-is [System.Data.DataTable])
- {
- $Table = $InputObject
- }
- else
- {
- if(-not $RetainColumns -or $Table.Columns.Count -eq 0)
- {
- #Clear out the Table Contents
- $Table.Clear()
- if($InputObject -eq $null){ return } #Empty Data
- $object = $null
- #find the first non null value
- foreach($item in $InputObject)
- {
- if($item -ne $null)
- {
- $object = $item
- break
- }
- }
- if($object -eq $null) { return } #All null then empty
- #Get all the properties in order to create the columns
- foreach ($prop in $object.PSObject.Get_Properties())
- {
- if(-not $FilterWMIProperties -or -not $prop.Name.StartsWith('__'))#filter out WMI properties
- {
- #Get the type from the Definition string
- $type = $null
- if($prop.Value -ne $null)
- {
- try{ $type = $prop.Value.GetType() } catch {}
- }
- if($type -ne $null) # -and [System.Type]::GetTypeCode($type) -ne 'Object')
- {
- [void]$table.Columns.Add($prop.Name, $type)
- }
- else #Type info not found
- {
- [void]$table.Columns.Add($prop.Name)
- }
- }
- }
- if($object -is [System.Data.DataRow])
- {
- foreach($item in $InputObject)
- {
- $Table.Rows.Add($item)
- }
- return @(,$Table)
- }
- }
- else
- {
- $Table.Rows.Clear()
- }
- foreach($item in $InputObject)
- {
- $row = $table.NewRow()
- if($item)
- {
- foreach ($prop in $item.PSObject.Get_Properties())
- {
- if($table.Columns.Contains($prop.Name))
- {
- $row.Item($prop.Name) = $prop.Value
- }
- }
- }
- [void]$table.Rows.Add($row)
- }
- }
- return @(,$Table)
- }
- #endregion
- #region Search Function
- function SearchGrid()
- {
- $RowIndex = 0
- $ColumnIndex = 0
- $seachString = $textboxSearch.Text
- if($seachString -eq "")
- {
- return
- }
- if($datagridviewResults.SelectedCells.Count -ne 0)
- {
- $startCell = $datagridviewResults.SelectedCells[0];
- $RowIndex = $startCell.RowIndex
- $ColumnIndex = $startCell.ColumnIndex + 1
- }
- $columnCount = $datagridviewResults.ColumnCount
- $rowCount = $datagridviewResults.RowCount
- for(;$RowIndex -lt $rowCount; $RowIndex++)
- {
- $Row = $datagridviewResults.Rows[$RowIndex]
- for(;$ColumnIndex -lt $columnCount; $ColumnIndex++)
- {
- $cell = $Row.Cells[$ColumnIndex]
- if($cell.Value -ne $null -and $cell.Value.ToString().IndexOf($seachString, [StringComparison]::OrdinalIgnoreCase) -ne -1)
- {
- $datagridviewResults.CurrentCell = $cell
- return
- }
- }
- $ColumnIndex = 0
- }
- $datagridviewResults.CurrentCell = $null
- [void][System.Windows.Forms.MessageBox]::Show("The search has reached the end of the grid.","String not Found")
- }
- #endregion
- $FormEvent_Load={
- #TODO: Initialize Form Controls here
- $webbrowser1.DocumentText = "$message";
- }
- $buttonExit_Click={
- #TODO: Place custom script here
- $MessageViewer.Close()
- }
- $buttonQuery_Click={
- #TODO: Place custom script here
- # ---------------------------------
- # Sample Code to Load Grid
- # ---------------------------------
- # $processes = Get-WmiObject Win32_Process -Namespace "Root\CIMV2"
- # Load-DataGridView -DataGridView $datagridviewResults -Item $processes
- # ---------------------------------
- # Sample Code to Load Sortable Data
- # ---------------------------------
- # $processes = Get-WmiObject Win32_Process -Namespace "Root\CIMV2"
- # $table = ConvertTo-DataTable -InputObject $processes -FilterWMIProperties
- # Load-DataGridView -DataGridView $datagridviewResults -Item $table
- }
- $webbrowser1_DocumentCompleted=[System.Windows.Forms.WebBrowserDocumentCompletedEventHandler]{
- #Event Argument: $_ = [System.Windows.Forms.WebBrowserDocumentCompletedEventArgs]
- #TODO: Place custom script here
- }
- # --End User Generated Script--
- #----------------------------------------------
- #region Generated Events
- #----------------------------------------------
- $Form_StateCorrection_Load=
- {
- #Correct the initial state of the form to prevent the .Net maximized form issue
- $MessageViewer.WindowState = $InitialFormWindowState
- }
- $Form_Cleanup_FormClosed=
- {
- #Remove all event handlers from the controls
- try
- {
- $webbrowser1.remove_DocumentCompleted($webbrowser1_DocumentCompleted)
- $MessageViewer.remove_Load($FormEvent_Load)
- $MessageViewer.remove_Load($Form_StateCorrection_Load)
- $MessageViewer.remove_FormClosed($Form_Cleanup_FormClosed)
- }
- catch [Exception]
- { }
- }
- #endregion Generated Events
- #----------------------------------------------
- #region Generated Form Code
- #----------------------------------------------
- $MessageViewer.SuspendLayout()
- #
- # MessageViewer
- #
- $MessageViewer.Controls.Add($webbrowser1)
- $MessageViewer.ClientSize = '584, 362'
- $MessageViewer.Name = "MessageViewer"
- $MessageViewer.StartPosition = 'CenterScreen'
- $MessageViewer.Text = "Message Viewer"
- $MessageViewer.add_Load($FormEvent_Load)
- #
- # webbrowser1
- #
- $webbrowser1.Dock = 'Fill'
- $webbrowser1.Location = '0, 0'
- $webbrowser1.MinimumSize = '20, 20'
- $webbrowser1.Name = "webbrowser1"
- $webbrowser1.Size = '584, 362'
- $webbrowser1.TabIndex = 5
- $webbrowser1.add_DocumentCompleted($webbrowser1_DocumentCompleted)
- $MessageViewer.ResumeLayout()
- #endregion Generated Form Code
- #----------------------------------------------
- #Save the initial state of the form
- $InitialFormWindowState = $MessageViewer.WindowState
- #Init the OnLoad event to correct the initial state of the form
- $MessageViewer.add_Load($Form_StateCorrection_Load)
- #Clean up the control events
- $MessageViewer.add_FormClosed($Form_Cleanup_FormClosed)
- #Show the Form
- return $MessageViewer.ShowDialog()
- } #End Function
- #Call OnApplicationLoad to initialize
- if((OnApplicationLoad) -eq $true)
- {
- #Call the form
- Call-web_psf | Out-Null
- #Perform cleanup
- OnApplicationExit
- }
- }
- #################################
- #### End Message Window
- ##############################
- <#
- .NOTES
- --------------------------------------------------------------------------------
- Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2014 v4.1.74
- Generated on: 11/13/2014 4:38 PM
- Generated by: David Septimus
- --------------------------------------------------------------------------------
- .DESCRIPTION
- GUI script generated by PowerShell Studio 2014
- #>
- #----------------------------------------------
- #region Application Functions
- #----------------------------------------------
- function OnApplicationLoad {
- #Note: This function is not called in Projects
- #Note: This function runs before the form is created
- #Note: To get the script directory in the Packager use: Split-Path $hostinvocation.MyCommand.path
- #Note: To get the console output in the Packager (Windows Mode) use: $ConsoleOutput (Type: System.Collections.ArrayList)
- #Important: Form controls cannot be accessed in this function
- #TODO: Add modules and custom code to validate the application load
- return $true #return true for success or false for failure
- }
- function OnApplicationExit {
- #Note: This function is not called in Projects
- #Note: This function runs after the form is closed
- #TODO: Add custom code to clean up and unload modules when the application exits
- $script:ExitCode = 0 #Set the exit code for the Packager
- }
- #endregion Application Functions
- #----------------------------------------------
- # Generated Form Function
- #----------------------------------------------
- function Call-form_psf {
- #----------------------------------------------
- #region Import the Assemblies
- #----------------------------------------------
- [void][reflection.assembly]::Load('mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
- [void][reflection.assembly]::Load('System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
- [void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
- [void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
- [void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
- [void][reflection.assembly]::Load('System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
- [void][reflection.assembly]::Load('System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
- [void][reflection.assembly]::Load('System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
- [void][reflection.assembly]::Load('System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
- #endregion Import Assemblies
- #----------------------------------------------
- #region Generated Form Objects
- #----------------------------------------------
- [System.Windows.Forms.Application]::EnableVisualStyles()
- $formMailViewer = New-Object 'System.Windows.Forms.Form'
- $labelPassword = New-Object 'System.Windows.Forms.Label'
- $labelUserName = New-Object 'System.Windows.Forms.Label'
- $labelMailbox = New-Object 'System.Windows.Forms.Label'
- $password = New-Object 'System.Windows.Forms.MaskedTextBox'
- $UserName = New-Object 'System.Windows.Forms.TextBox'
- $Mailbox = New-Object 'System.Windows.Forms.TextBox'
- $GetMailButton = New-Object 'System.Windows.Forms.Button'
- $EmailList = New-Object 'System.Windows.Forms.DataGridView'
- $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'
- #endregion Generated Form Objects
- #----------------------------------------------
- # User Generated Script
- #----------------------------------------------
- $formMailViewer_Load={
- #TODO: Initialize Form Controls here
- }
- #region Control Helper Functions
- function Load-DataGridView
- {
- <#
- .SYNOPSIS
- This functions helps you load items into a DataGridView.
- .DESCRIPTION
- Use this function to dynamically load items into the DataGridView control.
- .PARAMETER DataGridView
- The ComboBox control you want to add items to.
- .PARAMETER Item
- The object or objects you wish to load into the ComboBox's items collection.
- .PARAMETER DataMember
- Sets the name of the list or table in the data source for which the DataGridView is displaying data.
- #>
- Param (
- [ValidateNotNull()]
- [Parameter(Mandatory=$true)]
- [System.Windows.Forms.DataGridView]$DataGridView,
- [ValidateNotNull()]
- [Parameter(Mandatory=$true)]
- $Item,
- [Parameter(Mandatory=$false)]
- [string]$DataMember
- )
- $DataGridView.SuspendLayout()
- $DataGridView.DataMember = $DataMember
- if ($Item -is [System.ComponentModel.IListSource]`
- -or $Item -is [System.ComponentModel.IBindingList] -or $Item -is [System.ComponentModel.IBindingListView] )
- {
- $DataGridView.DataSource = $Item
- }
- else
- {
- $array = New-Object System.Collections.ArrayList
- if ($Item -is [System.Collections.IList])
- {
- $array.AddRange($Item)
- }
- else
- {
- $array.Add($Item)
- }
- $DataGridView.DataSource = $array
- }
- $DataGridView.ResumeLayout()
- }
- #endregion
- $labelMailbox_Click={
- #TODO: Place custom script here
- }
- $GetMailButton_Click={
- #TODO: Place custom script here
- Get-Mail -UserPrincipalName $UserName.Text -Password $password.Text -Mailbox $Mailbox.Text
- }
- $EmailList_MouseDoubleClick=[System.Windows.Forms.MouseEventHandler]{
- #Event Argument: $_ = [System.Windows.Forms.MouseEventArgs]
- #TODO: Place custom script here
- }
- # --End User Generated Script--
- #----------------------------------------------
- #region Generated Events
- #----------------------------------------------
- $Form_StateCorrection_Load=
- {
- #Correct the initial state of the form to prevent the .Net maximized form issue
- $formMailViewer.WindowState = $InitialFormWindowState
- }
- $Form_Cleanup_FormClosed=
- {
- #Remove all event handlers from the controls
- try
- {
- $labelMailbox.remove_Click($labelMailbox_Click)
- $EmailList.remove_MouseDoubleClick($EmailList_MouseDoubleClick)
- $formMailViewer.remove_Load($formMailViewer_Load)
- $formMailViewer.remove_Load($Form_StateCorrection_Load)
- $formMailViewer.remove_FormClosed($Form_Cleanup_FormClosed)
- }
- catch [Exception]
- { }
- }
- #endregion Generated Events
- #----------------------------------------------
- #region Generated Form Code
- #----------------------------------------------
- $formMailViewer.SuspendLayout()
- #
- # formMailViewer
- #
- $formMailViewer.Controls.Add($labelPassword)
- $formMailViewer.Controls.Add($labelUserName)
- $formMailViewer.Controls.Add($labelMailbox)
- $formMailViewer.Controls.Add($password)
- $formMailViewer.Controls.Add($UserName)
- $formMailViewer.Controls.Add($Mailbox)
- $formMailViewer.Controls.Add($GetMailButton)
- $formMailViewer.Controls.Add($EmailList)
- $formMailViewer.ClientSize = '1048, 539'
- $formMailViewer.Name = "formMailViewer"
- $formMailViewer.Text = "Mail Viewer for Office 365"
- $formMailViewer.add_Load($formMailViewer_Load)
- #
- # labelPassword
- #
- $labelPassword.Location = '794, 120'
- $labelPassword.Name = "labelPassword"
- $labelPassword.Size = '63, 23'
- $labelPassword.TabIndex = 7
- $labelPassword.Text = "Password"
- #
- # labelUserName
- #
- $labelUserName.Location = '794, 93'
- $labelUserName.Name = "labelUserName"
- $labelUserName.Size = '63, 23'
- $labelUserName.TabIndex = 6
- $labelUserName.Text = "User Name"
- #
- # labelMailbox
- #
- $labelMailbox.Location = '794, 66'
- $labelMailbox.Name = "labelMailbox"
- $labelMailbox.Size = '63, 23'
- $labelMailbox.TabIndex = 5
- $labelMailbox.Text = "Mailbox"
- $labelMailbox.add_Click($labelMailbox_Click)
- #
- # password
- #
- $password.Location = '863, 117'
- $password.Name = "password"
- $password.PasswordChar = '•'
- $password.Size = '157, 20'
- $password.TabIndex = 4
- #
- # UserName
- #
- $UserName.Location = '863, 90'
- $UserName.Name = "UserName"
- $UserName.Size = '157, 20'
- $UserName.TabIndex = 3
- #
- # Mailbox
- #
- $Mailbox.Location = '863, 63'
- $Mailbox.Name = "Mailbox"
- $Mailbox.Size = '157, 20'
- $Mailbox.TabIndex = 2
- #
- # GetMailButton
- #
- $GetMailButton.Location = '945, 143'
- $GetMailButton.Name = "GetMailButton"
- $GetMailButton.Size = '75, 23'
- $GetMailButton.TabIndex = 1
- $GetMailButton.Text = "Get Mail"
- $GetMailButton.UseVisualStyleBackColor = $True
- $GetMailButton.add_Click($GetMailButton_Click)
- #
- # EmailList
- #
- $EmailList.AllowUserToAddRows = $False
- $EmailList.AllowUserToDeleteRows = $False
- $EmailList.AllowUserToOrderColumns = $True
- $EmailList.ColumnHeadersHeightSizeMode = 'AutoSize'
- $EmailList.Location = '12, 42'
- $EmailList.Name = "EmailList"
- $EmailList.ReadOnly = $True
- $EmailList.SelectionMode = 'FullRowSelect'
- $EmailList.Size = '767, 467'
- $EmailList.TabIndex = 0
- $EmailList.add_MouseDoubleClick($EmailList_MouseDoubleClick)
- $formMailViewer.ResumeLayout()
- #endregion Generated Form Code
- #----------------------------------------------
- #Save the initial state of the form
- $InitialFormWindowState = $formMailViewer.WindowState
- #Init the OnLoad event to correct the initial state of the form
- $formMailViewer.add_Load($Form_StateCorrection_Load)
- #Clean up the control events
- $formMailViewer.add_FormClosed($Form_Cleanup_FormClosed)
- #Show the Form
- return $formMailViewer.ShowDialog()
- } #End Function
- #Call OnApplicationLoad to initialize
- if((OnApplicationLoad) -eq $true)
- {
- #Call the form
- Call-form_psf | Out-Null
- #Perform cleanup
- OnApplicationExit
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement