Skip to content

Commit 01e81d4

Browse files
authored
Initial commit from production version
1 parent 58213bc commit 01e81d4

13 files changed

+11677
-0
lines changed
6.14 KB
Loading
141 KB
Binary file not shown.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<#
2+
.SYNOPSIS
3+
This script is a template that allows you to extend the toolkit with your own custom functions.
4+
.DESCRIPTION
5+
The script is automatically dot-sourced by the AppDeployToolkitMain.ps1 script.
6+
.NOTES
7+
Toolkit Exit Code Ranges:
8+
60000 - 68999: Reserved for built-in exit codes in Deploy-Application.ps1, Deploy-Application.exe, and AppDeployToolkitMain.ps1
9+
69000 - 69999: Recommended for user customized exit codes in Deploy-Application.ps1
10+
70000 - 79999: Recommended for user customized exit codes in AppDeployToolkitExtensions.ps1
11+
.LINK
12+
http://psappdeploytoolkit.com
13+
#>
14+
[CmdletBinding()]
15+
Param (
16+
)
17+
18+
##*===============================================
19+
##* VARIABLE DECLARATION
20+
##*===============================================
21+
22+
# Variables: Script
23+
[string]$appDeployToolkitExtName = 'PSAppDeployToolkitExt'
24+
[string]$appDeployExtScriptFriendlyName = 'App Deploy Toolkit Extensions'
25+
[version]$appDeployExtScriptVersion = [version]'1.5.0'
26+
[string]$appDeployExtScriptDate = '06/11/2015'
27+
[hashtable]$appDeployExtScriptParameters = $PSBoundParameters
28+
29+
##*===============================================
30+
##* FUNCTION LISTINGS
31+
##*===============================================
32+
33+
# <Your custom functions go here>
34+
35+
##*===============================================
36+
##* END FUNCTION LISTINGS
37+
##*===============================================
38+
39+
##*===============================================
40+
##* SCRIPT BODY
41+
##*===============================================
42+
43+
If ($scriptParentPath) {
44+
Write-Log -Message "Script [$($MyInvocation.MyCommand.Definition)] dot-source invoked by [$(((Get-Variable -Name MyInvocation).Value).ScriptName)]" -Source $appDeployToolkitExtName
45+
}
46+
Else {
47+
Write-Log -Message "Script [$($MyInvocation.MyCommand.Definition)] invoked directly" -Source $appDeployToolkitExtName
48+
}
49+
50+
##*===============================================
51+
##* END SCRIPT BODY
52+
##*===============================================
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
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+
##*===============================================
293 KB
Binary file not shown.

0 commit comments

Comments
 (0)