1+ <#
2+ . SYNOPSIS
3+ Displays a graphical console to browse the help for the App Deployment Toolkit functions
4+ . DESCRIPTION
5+ Displays a graphical console to browse the help for the App Deployment Toolkit functions
6+ . EXAMPLE
7+ AppDeployToolkitHelp.ps1
8+ . NOTES
9+ . LINK
10+ http://psappdeploytoolkit.com
11+ #>
12+
13+ # #*===============================================
14+ # #* VARIABLE DECLARATION
15+ # #*===============================================
16+
17+ # # Variables: Script
18+ [string ]$appDeployToolkitHelpName = ' PSAppDeployToolkitHelp'
19+ [string ]$appDeployHelpScriptFriendlyName = ' App Deploy Toolkit Help'
20+ [version ]$appDeployHelpScriptVersion = [version ]' 3.6.5'
21+ [string ]$appDeployHelpScriptDate = ' 08/17/2015'
22+
23+ # # Variables: Environment
24+ [string ]$scriptDirectory = Split-Path - Path $MyInvocation.MyCommand.Definition - Parent
25+ # Dot source the App Deploy Toolkit Functions
26+ . " $scriptDirectory \AppDeployToolkitMain.ps1" - DisableLogging
27+
28+ # #*===============================================
29+ # #* END VARIABLE DECLARATION
30+ # #*===============================================
31+
32+ # #*===============================================
33+ # #* FUNCTION LISTINGS
34+ # #*===============================================
35+
36+ Function Show-HelpConsole {
37+ # # Import the Assemblies
38+ Add-Type - AssemblyName ' System.Windows.Forms' - ErrorAction ' Stop'
39+ Add-Type - AssemblyName System.Drawing - ErrorAction ' Stop'
40+
41+ # # Form Objects
42+ $HelpForm = New-Object - TypeName ' System.Windows.Forms.Form'
43+ $HelpListBox = New-Object - TypeName ' System.Windows.Forms.ListBox'
44+ $HelpTextBox = New-Object - TypeName ' System.Windows.Forms.RichTextBox'
45+ $InitialFormWindowState = New-Object - TypeName ' System.Windows.Forms.FormWindowState'
46+
47+ # # Form Code
48+ $System_Drawing_Size = New-Object - TypeName ' System.Drawing.Size'
49+ $System_Drawing_Size.Height = 665
50+ $System_Drawing_Size.Width = 957
51+ $HelpForm.ClientSize = $System_Drawing_Size
52+ $HelpForm.DataBindings.DefaultDataSourceUpdateMode = 0
53+ $HelpForm.Name = ' HelpForm'
54+ $HelpForm.Text = ' PowerShell App Deployment Toolkit Help Console'
55+ $HelpForm.WindowState = ' Normal'
56+ $HelpForm.ShowInTaskbar = $true
57+ $HelpForm.FormBorderStyle = ' Fixed3D'
58+ $HelpForm.MaximizeBox = $false
59+ $HelpForm.Icon = New-Object - TypeName ' System.Drawing.Icon' - ArgumentList $AppDeployLogoIcon
60+ $HelpListBox.Anchor = 7
61+ $HelpListBox.BorderStyle = 1
62+ $HelpListBox.DataBindings.DefaultDataSourceUpdateMode = 0
63+ $HelpListBox.Font = New-Object - TypeName ' System.Drawing.Font' - ArgumentList (' Microsoft Sans Serif' , 9.75 , 1 , 3 , 1 )
64+ $HelpListBox.FormattingEnabled = $true
65+ $HelpListBox.ItemHeight = 16
66+ $System_Drawing_Point = New-Object - TypeName ' System.Drawing.Point'
67+ $System_Drawing_Point.X = 0
68+ $System_Drawing_Point.Y = 0
69+ $HelpListBox.Location = $System_Drawing_Point
70+ $HelpListBox.Name = ' HelpListBox'
71+ $System_Drawing_Size = New-Object - TypeName ' System.Drawing.Size'
72+ $System_Drawing_Size.Height = 658
73+ $System_Drawing_Size.Width = 271
74+ $HelpListBox.Size = $System_Drawing_Size
75+ $HelpListBox.Sorted = $true
76+ $HelpListBox.TabIndex = 2
77+ $HelpListBox.add_SelectedIndexChanged ({ $HelpTextBox.Text = Get-Help - Name $HelpListBox.SelectedItem - Detailed | Out-String })
78+ $helpFunctions = Get-Command - CommandType ' Function' | Where-Object { ($_.HelpUri -match ' psappdeploytoolkit' ) -and ($_.Definition -notmatch ' internal script function' ) } | Select-Object - ExpandProperty Name
79+ ForEach ($helpFunction in $helpFunctions ) {
80+ $null = $HelpListBox.Items.Add ($helpFunction )
81+ }
82+ $HelpForm.Controls.Add ($HelpListBox )
83+ $HelpTextBox.Anchor = 11
84+ $HelpTextBox.BorderStyle = 1
85+ $HelpTextBox.DataBindings.DefaultDataSourceUpdateMode = 0
86+ $HelpTextBox.Font = New-Object - TypeName ' System.Drawing.Font' - ArgumentList (' Microsoft Sans Serif' , 8.5 , 0 , 3 , 1 )
87+ $HelpTextBox.ForeColor = [System.Drawing.Color ]::FromArgb(255 , 0 , 0 , 0 )
88+ $System_Drawing_Point = New-Object - TypeName System.Drawing.Point
89+ $System_Drawing_Point.X = 277
90+ $System_Drawing_Point.Y = 0
91+ $HelpTextBox.Location = $System_Drawing_Point
92+ $HelpTextBox.Name = ' HelpTextBox'
93+ $HelpTextBox.ReadOnly = $True
94+ $System_Drawing_Size = New-Object - TypeName ' System.Drawing.Size'
95+ $System_Drawing_Size.Height = 658
96+ $System_Drawing_Size.Width = 680
97+ $HelpTextBox.Size = $System_Drawing_Size
98+ $HelpTextBox.TabIndex = 1
99+ $HelpTextBox.Text = ' '
100+ $HelpForm.Controls.Add ($HelpTextBox )
101+
102+ # # Save the initial state of the form
103+ $InitialFormWindowState = $HelpForm.WindowState
104+ # # Init the OnLoad event to correct the initial state of the form
105+ $HelpForm.add_Load ($OnLoadForm_StateCorrection )
106+ # # Show the Form
107+ $null = $HelpForm.ShowDialog ()
108+ }
109+
110+ # #*===============================================
111+ # #* END FUNCTION LISTINGS
112+ # #*===============================================
113+
114+ # #*===============================================
115+ # #* SCRIPT BODY
116+ # #*===============================================
117+
118+ Write-Log - Message " Load [$appDeployHelpScriptFriendlyName ] console..." - Source $appDeployToolkitHelpName
119+
120+ # # Show the help console
121+ Show-HelpConsole
122+
123+ Write-Log - Message " [$appDeployHelpScriptFriendlyName ] console closed." - Source $appDeployToolkitHelpName
124+
125+ # #*===============================================
126+ # #* END SCRIPT BODY
127+ # #*===============================================
0 commit comments