519 lines
24 KiB
PowerShell
519 lines
24 KiB
PowerShell
#------------------------------------------------------------------------
|
|
# Source File Information (DO NOT MODIFY)
|
|
# Source ID: 676f8db7-35c7-452d-b353-a4b40f26243a
|
|
# Source File: Form-Template.psf
|
|
#------------------------------------------------------------------------
|
|
#region File Recovery Data (DO NOT MODIFY)
|
|
<#RecoveryData:
|
|
RAUAAB+LCAAAAAAABAC9VNtKwzAYvhd8h5Dr2oPd3AZtYXTuxtNwQ72TrP07o2lSknSzPr3p2g1x
|
|
QkHGKJSk+Q7/KQ0eIRFrkNWEaILMQlHBQ3xpezg6P0MoeJB0RTlhU8rgnuQQTYXMLxaQF4xosAuV
|
|
Bc4BpmEu3yHRSFcFhHheKQ25/Ux5KjbKrkWat4X+OrLQUxtKz3brx0JxyXQpIeRQakmYhWblktHk
|
|
BqqF+AAeLgcD0k/6V97I74E7HGHETSghzoyeh1HyRlkqDQ7HgmspmGoSNIHOpChA6qoljEst5glh
|
|
MKE58DoIA72ykOcHzg7aRb0TKWBTKq47OTGjwPWcfhnCwDU+/nDYSaqrjKNtap3YBXxqvG3bIfR6
|
|
bbxb3K0gaav5Wq8DZ3vaNNNputlsxkpBbooPaqfTfqmiXCVCMro8QgMDZ6/626UZmVN4HH0sux3r
|
|
m3gaI0k2lK/+4+X6WT8bZJ6X9l3ik26vl5ydJKdYSDi+0X7bjHzg/PxrRt9OzyrdRAUAAA==#>
|
|
#endregion
|
|
|
|
<#
|
|
.NOTES
|
|
--------------------------------------------------------------------------------
|
|
Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.141
|
|
Generated on: 8/29/2017 11:53 AM
|
|
Generated by: Haidey2
|
|
--------------------------------------------------------------------------------
|
|
.DESCRIPTION
|
|
GUI script generated by PowerShell Studio 2017
|
|
#>
|
|
|
|
|
|
#----------------------------------------------
|
|
#region Application Functions
|
|
#----------------------------------------------
|
|
|
|
#endregion Application Functions
|
|
|
|
#----------------------------------------------
|
|
# Generated Form Function
|
|
#----------------------------------------------
|
|
function Show-Form-Template_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.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')
|
|
#endregion Import Assemblies
|
|
|
|
#----------------------------------------------
|
|
#region Generated Form Objects
|
|
#----------------------------------------------
|
|
[System.Windows.Forms.Application]::EnableVisualStyles()
|
|
$form1 = New-Object 'System.Windows.Forms.Form'
|
|
$InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'
|
|
|
|
|
|
$Script:Output = New-Object System.Windows.Forms.TextBox
|
|
$Script:Collection_DropDownBox = New-Object System.Windows.Forms.ComboBox
|
|
$Script:Deployment_DropDownBox = New-Object System.Windows.Forms.ComboBox
|
|
|
|
$GroupBox = New-Object System.Windows.Forms.GroupBox
|
|
$Script:RadioButton_Window = New-Object System.Windows.Forms.RadioButton
|
|
$Script:RadioButton_GridView = New-Object System.Windows.Forms.RadioButton
|
|
$Script:RadioButton_CSV = New-Object System.Windows.Forms.RadioButton
|
|
$Button_Go = New-Object System.Windows.Forms.Button
|
|
$Script:TextBox_CollectionName = New-Object “System.Windows.Forms.TextBox”
|
|
|
|
#$PanelEventLogs_Events = New-Object 'System.Windows.Forms.Panel'
|
|
#$PanelEventLogs_Filter = New-Object 'System.Windows.Forms.Panel'
|
|
|
|
|
|
$Text_ELogs_ServerName = New-Object 'System.Windows.Forms.TextBox'
|
|
$Text_ELogs_EventID = New-Object 'System.Windows.Forms.TextBox'
|
|
$Text_Elogs_DaysBack = New-Object 'System.Windows.Forms.TextBox'
|
|
|
|
$Button_ELogs_Connect = New-Object 'System.Windows.Forms.Button'
|
|
|
|
|
|
|
|
|
|
$Location = Split-Path $MyInvocation.MyCommand.Path -Parent
|
|
|
|
$Script:ALL_Patch_Servers = @()
|
|
$Script:Responding = @()
|
|
$Script:NotResponding = @()
|
|
$Global:Collection_Name = ""
|
|
$Global:Select_Tool
|
|
$Global:Output_Type = ""
|
|
|
|
#endregion Generated Form Objects
|
|
|
|
#----------------------------------------------
|
|
# User Generated Script
|
|
#----------------------------------------------
|
|
|
|
$form1_Load={
|
|
#TODO: Initialize Form Controls here
|
|
|
|
}
|
|
|
|
$Script:Collection_DropDownBox_SelectedIndexChanged={
|
|
$Script:Output.Text = $Script:Collection_DropDownBox.Text
|
|
}
|
|
|
|
$Button_Go_Click = { $Script:Output.Text = "Button clicked" }
|
|
|
|
##############################################
|
|
Function Update-Dropdown1 {
|
|
# $Collections += $Script:Collection_DropDownBox.text
|
|
$Collections = @("Collection-Servers","Ping-Collection","Check_Uptime","Test-Service","Remotely Update Policy","Software Update Status","Tool7")
|
|
$Collections | % { $Script:Collection_DropDownBox.Items.Add($_) }
|
|
}
|
|
##################################################################################################################
|
|
Function temp {
|
|
$outputBox.Clear()
|
|
#$Script:outputBox.text = $Script:Collection_DropDownBox.text | Out-String
|
|
$Global:Collection_Name = $Script:TextBox_CollectionName.Text
|
|
#$Global:Select_Tool = $RadioButton1.Checked
|
|
|
|
$Global:Select_Tool = $DropDownBox.text
|
|
#$Global:Output_Type =
|
|
If ($Script:RadioButton_Window.Checked -eq $true) { $Global:Output_Type = "Window"; $outputBox.Text = "Window_Radio1 Checked: $($Script:RadioButton_Window.Checked)" | Out-String }
|
|
ElseIf ($Script:RadioButton_GridView.Checked -eq $true) { $Global:Output_Type = "Gridview"; $outputBox.Text = "Gridview_Radio2 Checked: $Script:RadioButton_GridView.Checked" | Out-String }
|
|
ElseIf ($Script:RadioButton_CSV.Checked -eq $true) { $Global:Output_Type = "Export"; $outputBox.Text = "CSV_Radio3 Checked: $Script:RadioButton_CSV.Checked" | Out-String }
|
|
|
|
If($Global:Collection_Name -and $Global:Select_Tool) {
|
|
# If($DropDownBox.text = "Tool1"){gcc}
|
|
Run-Tool
|
|
$Script:TextBox_CollectionName.clear()
|
|
$DropDownBox.text = "----Select Tool----"
|
|
Clear-Variables
|
|
}#endIf
|
|
Else { #$T = { Write-Host "You must enter Collection Name ............!!" -ForegroundColor Red }
|
|
$Script:outputBox.SelectionColor = 'red'
|
|
$Script:outputBox.Text = "You must select 'Tool' and enter Collection Name............!!"
|
|
}
|
|
|
|
Run-Defaults
|
|
}#endFunction
|
|
|
|
|
|
##################################################################################################################
|
|
Function SCCM-Module {
|
|
|
|
If(!(Get-PSDrive).Name -eq "sccm-drive") {
|
|
Import-Module 'C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1'
|
|
New-PSDrive -Name SCCM-Drive -PSProvider "AdminUI.PS.Provider\CMSite" -Root "PNCRASCCM001.ccx.carecentrix.com" -Description "SCCM Site"
|
|
}#endIf
|
|
CD sccm-drive:
|
|
}#endFunction
|
|
|
|
##################################################################################################################
|
|
Function Run-Tool {
|
|
|
|
Switch($Global:Select_Tool) {
|
|
Collection-Servers { Collection-Servers; Write-Host "Tool Selected: $Global:Select_Tool" }
|
|
Ping-Collection { Ping_Collection }
|
|
Check_Uptime { Check_Uptime }
|
|
Test-Service { Test-Service }
|
|
#"Remotely Update Policy" { $outputBox.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String }
|
|
"Remotely Update Policy" { $outputBox.Text = Invoke-Expression $Location\Tool-Remotely-Restart-SCCMSyncCycle.ps1 | ft -AutoSize | Out-String }
|
|
"Software Update Status" { $outputBox.Text = & "$Location\Tool-Get-SCCMSoftwareUpdateStatus.ps1" -Dep_ID 16778048 | ft -AutoSize | Out-String}
|
|
}#endSwitch
|
|
#Clear-Variables
|
|
}#endFunction
|
|
##################################################################################################################
|
|
Function Run-Defaults {
|
|
$Script:TextBox_CollectionName.Text = "Nabil - Test Collection"
|
|
$Script:RadioButton1.Checked = $true
|
|
}
|
|
##################################################################################################################
|
|
Function Clear-Variables {
|
|
$Global:Collection_Name = ""
|
|
$Global:Select_Tool = ""
|
|
$Global:Output_Type = ""
|
|
|
|
$Script:ALL_Patch_Servers = @()
|
|
}
|
|
##################################################################################################################
|
|
Function Display-Results {
|
|
#Param($Global:Output_Type,$Final_Result)
|
|
Write-Host "DisplayType: $($Global:Output_Type)"
|
|
Switch ($Global:Output_Type){
|
|
|
|
Window { $Script:outputBox.Text = $Script:ALL_Patch_Servers | Out-String}
|
|
Gridview { $Script:ALL_Patch_Servers | Out-GridView }
|
|
Export { $Script:ALL_Patch_Servers | Export-Csv -Path $Location\Results.csv -NoTypeInformation; ii $Location\Results.csv }
|
|
|
|
}#endSwitch
|
|
|
|
}
|
|
#############################################################################################################################################################
|
|
Function Collection-Servers {
|
|
#Param($Coll_Name)
|
|
|
|
Write-Host "Collection:$Global:Collection_Name"
|
|
|
|
SCCM-Module
|
|
#CD sccm-drive:
|
|
$Script:DeviceCollection_MemberCount = Get-CMDeviceCollection -Name $Global:Collection_Name | select Name,MemberCount
|
|
$Script:DeviceCollection_ServerNames = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name,IsClient #| Export-Csv "E:\SCCM-Files\SCCM-Scripts\Files\$Global:Collection_Name.csv" -NoTypeInformation
|
|
#$ServerName = $DeviceCollection_ServerNames.Name
|
|
Set-Location c:
|
|
|
|
#$Script:Temp = Get-CMCollectionMember -CollectionName $Global:Collection_Name #| select Name,IsClient
|
|
|
|
$Script:DeviceCollection_ServerNames | % {
|
|
$Obj = New-Object -TypeName PSObject
|
|
$Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_.Name
|
|
$Obj | Add-Member -MemberType NoteProperty -Name ClientInstalled -Value $_.IsClient
|
|
$Obj | Add-Member -MemberType NoteProperty -Name CollectionName -Value $Global:Collection_Name
|
|
#$Obj | Add-Member -MemberType NoteProperty -Name CollectionMemberCount -Value {(Get-CMCollectionMember -Name $Global:Collection_Name).MemberCount}
|
|
|
|
$Obj
|
|
$Script:ALL_Patch_Servers += $Obj
|
|
|
|
}#end%
|
|
|
|
# $Script:outputBox.Text = $Script:ALL_Patch_Servers | Out-String
|
|
Display-Results #-Final_Result $Script:ALL_Patch_Servers
|
|
Write-Host "$Script:ALL_Patch_Servers"
|
|
$Script:ALL_Patch_Servers | Export-Csv $Location\Current-Collection-Servers.csv -NoTypeInformation
|
|
|
|
}#endFunction
|
|
#############################################################################################################################################################
|
|
Function Ping_Collection {
|
|
|
|
$Ping_Result = @()
|
|
Write-Host "Total Server Count: $($Script:ALL_Patch_Servers.count)" -ForegroundColor Green
|
|
Write-Host ""
|
|
|
|
SCCM-Module
|
|
#CD sccm-drive:
|
|
$Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name
|
|
Set-Location c:
|
|
$Script:DeviceCollection_ServerNames1.Name | % {
|
|
|
|
$Obj = New-Object -TypeName PSObject
|
|
If (Test-Connection $_ -Count 1 -ErrorAction SilentlyContinue ) {
|
|
#Write-Host "Responding:---- $_ " -ForegroundColor Green
|
|
#$Script:outputBox.AppendText("Responding: $_")
|
|
|
|
$Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_
|
|
$Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!"
|
|
$Ping_Result += $Obj
|
|
|
|
}#endIf
|
|
|
|
Else {
|
|
#$Script:outputBox.AppendText("NOT Responding: $_")
|
|
$NotResponding += $_
|
|
$Obj | Add-Member -MemberType NoteProperty -Name Server -Value $_
|
|
$Obj | Add-Member -MemberType NoteProperty -Name Responding -Value "No!"
|
|
$Ping_Result += $Obj
|
|
}
|
|
}#end%
|
|
$Script:outputBox.Text = $Ping_Result | ft -AutoSize | Out-String
|
|
|
|
write-host "-------------------------------------------------------"
|
|
Write-host "$($Responding.count) / $($DeviceCollection_ServerNames1.count) -- Responding" -foregroundcolor Green
|
|
Write-host "$($NotResponding.count) / $($DeviceCollection_ServerNames1.count) -- NOT Responding" -foregroundcolor Red
|
|
|
|
Write-Host "Servers NOT Responding: $NotResponding " -ForegroundColor Red
|
|
|
|
}#endFunction
|
|
#############################################################################################################################################################
|
|
Function Check_Uptime {
|
|
SCCM-Module
|
|
$Script:DeviceCollection_ServerNames1 = Get-CMCollectionMember -CollectionName $Global:Collection_Name | select Name
|
|
$Script:outputBox.Text = $Script:DeviceCollection_ServerNames1.name | % { gwmi win32_operatingsystem -ComputerName $_ -ErrorAction SilentlyContinue | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}}} | sort LastBootup -descending | Out-String
|
|
|
|
}
|
|
|
|
#############################################################################################################################################################
|
|
Function Deployment-List {
|
|
Param($Deployment_History)
|
|
SCCM-Module
|
|
$Deployments = Get-CMDeployment | ? { $_.deploymenttime -gt ((Get-Date).AddDays(-"$Deployment_History")) }
|
|
|
|
#$T | select ApplicationName,CollectionName,DeploymentTime,AssignmentID,SoftwareName | % { $Deployment_DropDownBox.Items.Add($_) }
|
|
$i = 0
|
|
$Q = "" #@()
|
|
|
|
foreach ($D in $Deployments) {
|
|
$Q = $D.ApplicationName + "-------------------------------------------------------" + $D.CollectionName
|
|
|
|
$Deployment_DropDownBox.Items.Add($Q)
|
|
$i++
|
|
}
|
|
|
|
|
|
#$T.ApplicationName | % { $Deployment_DropDownBox.Items.Add($_) }
|
|
|
|
}#endFunction
|
|
#############################################################################################################################################################
|
|
Function Test-Service {
|
|
$T = Get-Service
|
|
$outputBox.Text = $T | ft -AutoSize | Out-String
|
|
}
|
|
##################################################################################################################
|
|
|
|
##################################################################################################################
|
|
# --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
|
|
{
|
|
$form1.remove_Load($form1_Load)
|
|
$form1.remove_Load($Form_StateCorrection_Load)
|
|
$form1.remove_FormClosed($Form_Cleanup_FormClosed)
|
|
|
|
#$PanelEventLogs_Events.remove_Paint($PanelEventLogs_Events_Paint)
|
|
#$PanelEventLogs_Filter.remove_Paint($PanelEventLogs_Filter_Paint)
|
|
|
|
$Text_Elogs_DaysBack.remove_TextChanged($Text_Elogs_DaysBack_TextChanged)
|
|
$Text_ELogs_ServerName.remove_TextChanged($Text_ELogs_ServerName_TextChanged)
|
|
$Text_ELogs_EventID.remove_TextChanged($Text_ELogs_EventID_TextChanged)
|
|
|
|
$Script:Output.remove_TextChanged($Output_TextChanged)
|
|
$Script:Collection_DropDownBox.remove_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged)
|
|
$Script:Deployment_DropDownBox.remove_SelectedIndexChanged($Script:Deployment_DropDownBox_SelectedIndexChanged)
|
|
$Script:RadioButton_Window.remove_SelectedIndexChanged($Script:RadioButton_Window_SelectedIndexChanged)
|
|
$Script:RadioButton_GridView.remove_SelectedIndexChanged($Script:RadioButton_GridView_SelectedIndexChanged)
|
|
$Script:RadioButton_CSV.remove_SelectedIndexChanged($Script:RadioButton_CSV_SelectedIndexChanged)
|
|
$Button_Go.remove_Click($Button_Go_Click)
|
|
|
|
}
|
|
catch { Out-Null <# Prevent PSScriptAnalyzer warning #> }
|
|
}
|
|
|
|
|
|
#$PanelEventLogs_Events_Paint=[System.Windows.Forms.PaintEventHandler]{ <#Event Argument: $_ = [System.Windows.Forms.PaintEventArgs]#> }
|
|
#$PanelEventLogs_Filter_Paint=[System.Windows.Forms.PaintEventHandler]{ }
|
|
|
|
$Text_ELogs_ServerName_TextChanged={}
|
|
$Text_Elogs_DaysBack_TextChanged={}
|
|
|
|
#endregion Generated Events
|
|
|
|
#----------------------------------------------
|
|
#region Generated Form Code
|
|
#----------------------------------------------
|
|
#
|
|
# form1
|
|
#
|
|
#$form1.Controls.Add($PanelEventLogs_Events)
|
|
#$form1.Controls.Add($PanelEventLogs_Filter)
|
|
|
|
$form1.Controls.Add($Output)
|
|
$form1.Controls.Add($Script:Collection_DropDownBox)
|
|
$form1.Controls.Add($Script:Deployment_DropDownBox)
|
|
$form1.Controls.Add($GroupBox)
|
|
$form1.controls.Add($Script:RadioButton_Window)
|
|
$form1.controls.Add($Script:RadioButton_GridView)
|
|
$form1.Controls.Add($Script:RadioButton_CSV)
|
|
$form1.Controls.Add($Button_Go)
|
|
$form1.Controls.Add($Script:TextBox_CollectionName)
|
|
|
|
|
|
$form1.AutoScaleDimensions = '6, 13'
|
|
$form1.AutoScaleMode = 'Font'
|
|
$form1.ClientSize = '1000, 800'
|
|
$form1.Name = 'form1'
|
|
$form1.Text = 'Form'
|
|
$form1.add_Load($form1_Load)
|
|
#endregion Generated Form Code
|
|
|
|
#----------------------------------------------
|
|
<#
|
|
$PanelEventLogs_Events.Controls.Add($Text_ELogs_ServerName)
|
|
$PanelEventLogs_Events.Controls.Add($Button_ELogs_Connect)
|
|
$PanelEventLogs_Events.Controls.Add($Button_ELogs_View)
|
|
$PanelEventLogs_Events.Controls.Add($Combobox_EventLogs_LogsList)
|
|
$PanelEventLogs_Events.Controls.Add($VCenterUserPassword)
|
|
$PanelEventLogs_Events.Controls.Add($CheckBoxUseWindowsLogin)
|
|
$PanelEventLogs_Events.Controls.Add($labelVCenterUserName)
|
|
$PanelEventLogs_Events.Controls.Add($labelVCenterPassword)
|
|
$PanelEventLogs_Events.Controls.Add($Script:Collection_DropDownBox)
|
|
$PanelEventLogs_Events.BackColor = '153,153,153'
|
|
$PanelEventLogs_Events.Location = '6, 6'
|
|
$PanelEventLogs_Events.Name = 'panelEventLogs_Events'
|
|
$PanelEventLogs_Events.Size = '598, 56'
|
|
$PanelEventLogs_Events.TabIndex = 0
|
|
$PanelEventLogs_Events.add_Paint($PanelEventLogs_Events_Paint)
|
|
|
|
$PanelEventLogs_Filter.Controls.Add($Combobox_ELogsFilter_Level)
|
|
$PanelEventLogs_Filter.Controls.Add($Text_ELogs_EventID)
|
|
$PanelEventLogs_Filter.Controls.Add($Text_Elogs_DaysBack)
|
|
$PanelEventLogs_Filter.Controls.Add($label_ELogs_Level)
|
|
$PanelEventLogs_Filter.Controls.Add($label_ELogs_EventID)
|
|
$PanelEventLogs_Filter.Controls.Add($label_ELogs_DaysBack)
|
|
$PanelEventLogs_Filter.BackColor = '255,255,212'
|
|
$PanelEventLogs_Filter.Location = '6, 62'
|
|
$PanelEventLogs_Filter.Name = 'PanelEventLogs_Filter'
|
|
$PanelEventLogs_Filter.Size = '598, 56'
|
|
$PanelEventLogs_Filter.BorderStyle = 'FixedSingle'
|
|
$PanelEventLogs_Filter.TabIndex = 0
|
|
$PanelEventLogs_Filter.add_Paint($PanelEventLogs_Filter_Paint)
|
|
#>
|
|
#
|
|
# $Text_ELogs_ServerName
|
|
#
|
|
$Text_ELogs_ServerName.Location = '8, 26'
|
|
$Text_ELogs_ServerName.Name = '$Text_ELogs_ServerName'
|
|
$Text_ELogs_ServerName.Size = '100, 20'
|
|
$Text_ELogs_ServerName.text = "l2012"
|
|
$Text_ELogs_ServerName.TabIndex = 6
|
|
$Text_ELogs_ServerName.add_TextChanged($Text_ELogs_ServerName_TextChanged)
|
|
#
|
|
#
|
|
# Text_ELogs_EventID
|
|
#
|
|
$Text_ELogs_EventID.Location = '115, 26'
|
|
$Text_ELogs_EventID.Name = 'Text_ELogs_EventID'
|
|
$Text_ELogs_EventID.Size = '40, 20'
|
|
$Text_ELogs_EventID.TabIndex = 7
|
|
$Text_ELogs_EventID.add_TextChanged($Text_ELogs_EventID_TextChanged)
|
|
#
|
|
# Text_Elogs_DaysBack
|
|
#
|
|
$Text_Elogs_DaysBack.Location = '175, 26'
|
|
$Text_Elogs_DaysBack.Name = 'Text_Elogs_DaysBack'
|
|
$Text_Elogs_DaysBack.Size = '40, 20'
|
|
$Text_Elogs_DaysBack.TabIndex = 7
|
|
$Text_Elogs_DaysBack.add_TextChanged($Text_Elogs_DaysBack_TextChanged)
|
|
#
|
|
# Output
|
|
#
|
|
$Output.Location = '10, 250'
|
|
$Output.Multiline = $True
|
|
$Output.Name = 'Output'
|
|
$Output.ScrollBars = 'both'
|
|
$Output.Size = '965, 500'
|
|
$Output.Font = 'Consolas, 8.25pt'
|
|
$Output.WordWrap = $False
|
|
$Output.TabIndex = 5
|
|
$Output.add_TextChanged($Output_TextChanged)
|
|
#
|
|
# ComboboxServiceStartMode
|
|
#
|
|
$Script:Collection_DropDownBox.FormattingEnabled = $True
|
|
$Script:Collection_DropDownBox.Location = '20, 80'
|
|
$Script:Collection_DropDownBox.Name = 'Script:Collection_DropDownBox'
|
|
$Script:Collection_DropDownBox.Size = '180, 20'
|
|
$Script:Collection_DropDownBox.TabIndex = 2
|
|
$Script:Collection_DropDownBox.Text = '--Tools--'
|
|
$Script:Collection_DropDownBox.add_SelectedIndexChanged($Script:Collection_DropDownBox_SelectedIndexChanged)
|
|
#
|
|
$Script:Deployment_DropDownBox.Location = '20,30'
|
|
$Script:Deployment_DropDownBox.Size = New-Object System.Drawing.Size(580,50)
|
|
$Script:Deployment_DropDownBox.DropDownHeight = 200
|
|
$Script:Deployment_DropDownBox.text = "----Select Deployment----"
|
|
#$Script:Deployment_DropDownBox.Visible = $false
|
|
#
|
|
$groupBox.Location = '270,70'
|
|
$groupBox.size = New-Object System.Drawing.Size(150,90)
|
|
$groupBox.text = "Select Output:"
|
|
|
|
$GroupBox.Controls.Add($Script:RadioButton_Window)
|
|
$GroupBox.Controls.Add($Script:RadioButton_GridView)
|
|
$GroupBox.Controls.Add($Script:RadioButton_CSV)
|
|
#
|
|
$Script:RadioButton_Window.Location = new-object System.Drawing.Point(15,15)
|
|
$Script:RadioButton_Window.size = New-Object System.Drawing.Size(130,20)
|
|
$Script:RadioButton_Window.Checked = $true
|
|
$Script:RadioButton_Window.Text = "Window"
|
|
#
|
|
$Script:RadioButton_GridView.Location = new-object System.Drawing.Point(15,35)
|
|
$Script:RadioButton_GridView.size = New-Object System.Drawing.Size(80,20)
|
|
$Script:RadioButton_GridView.Checked = $False
|
|
$Script:RadioButton_GridView.Text = "GridView"
|
|
#
|
|
$Script:RadioButton_CSV.Location = new-object System.Drawing.Point(15,55)
|
|
$Script:RadioButton_CSV.size = New-Object System.Drawing.Size(80,20)
|
|
$Script:RadioButton_CSV.Checked = $False
|
|
$Script:RadioButton_CSV.Text = "CSV"
|
|
#
|
|
$Button_Go.Location = New-Object System.Drawing.Size(450,75)
|
|
$Button_Go.Size = New-Object System.Drawing.Size(110,80)
|
|
$Button_Go.Text = "Go"
|
|
#$Button_Go.Add_Click({temp})
|
|
$Button_Go.Add_Click($Button_Go_Click)
|
|
#
|
|
$Script:TextBox_CollectionName.Left = 20;
|
|
$Script:TextBox_CollectionName.Top = 130;
|
|
$Script:TextBox_CollectionName.width = 200;
|
|
$Script:TextBox_CollectionName.Text = "Nabil - Test Collection"
|
|
#
|
|
############################################################################
|
|
Update-Dropdown1
|
|
$Script:Output.Text = "hello"
|
|
|
|
|
|
############################################################################
|
|
|
|
#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-Form-Template_psf | Out-Null
|