forked from jrussellfreelance/powershell-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPowershellHelp.ps1
More file actions
31 lines (27 loc) · 1.01 KB
/
PowershellHelp.ps1
File metadata and controls
31 lines (27 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$commandsList_SelectedIndexChanged = {
[System.Windows.Forms.Cursor]::Current = [System.Windows.Forms.Cursors]::WaitCursor
$selected = $commandsList.SelectedIndex
$cmd = $commandsList.Items[$selected].ToString()
$helpBox.Text = Get-Help $cmd | Out-String
$detailedHelp.Text = Get-Help $cmd -Detailed | Out-String
$examplesBox.Text = Get-Help $cmd -Examples | Out-String
[System.Windows.Forms.Cursor]::Current = [System.Windows.Forms.Cursors]::Default
}
$MainForm_Load = {
[System.Windows.Forms.Cursor]::Current = [System.Windows.Forms.Cursors]::WaitCursor
$commands = Get-Command | Sort-Object Name
foreach ($command in $commands) {
$commandsList.Items.Add($command)
}
[System.Windows.Forms.Cursor]::Current = [System.Windows.Forms.Cursors]::Default
$searchBox_TextChanged = {
$commandsList.Items.Clear()
foreach ($item in $commands) {
if ($searchBox.Text -match $item) {
$commandsList.Items.Add($item)
}
}
}
}
. (Join-Path $PSScriptRoot 'PowershellHelp.designer.ps1')
$MainForm.ShowDialog()