-
Notifications
You must be signed in to change notification settings - Fork 0
/
Get-eXtremeDirectoryHelp.ps1
68 lines (58 loc) · 1.61 KB
/
Get-eXtremeDirectoryHelp.ps1
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<#
.SYNOPSIS
Shows help summary for all eXtreme Directory scripts.
.DESCRIPTION
Shows help summary for all eXtreme Directory scripts.
.INPUTS
None.
.OUTPUTS
None.
.EXAMPLE
PS> .\Get-eXtremeDirectoryHelp
#>
<#
.BASEPARAMETERS Silent
.TODO
#>
#Requires -Version 5.0
#Requires -Modules Varan.PowerShell.Base
#Requires -Modules Varan.PowerShell.Common
#Requires -Modules Varan.PowerShell.Validation
using module Varan.PowerShell.Validation
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'None')]
param (
)
DynamicParam { Build-BaseParameters }
Begin
{
Write-LogTrace "Execute: $(Get-RootScriptName)"
$cmd = @{}
if(Get-BaseParamHelpFull) { $cmd.HelpFull = $true }
if(Get-BaseParamHelpDetail) { $cmd.HelpDetail = $true }
if(Get-BaseParamHelpSynopsis) { $cmd.HelpSynopsis = $true }
if($cmd.Count -gt 1) { Write-DisplayHelp -Name "$(Get-RootScriptPath)" -HelpDetail }
if($cmd.Count -eq 1) { Write-DisplayHelp -Name "$(Get-RootScriptPath)" @cmd }
}
Process
{
try
{
$scriptCol = "$('Script'.PadRight(38, ' '))"
$aliasCol = "$('Alias'.PadRight(16, ' '))"
$descCol = 'Description'
Write-DisplayHost "$scriptCol$aliasCol$descCol" -Style HelpItem
Get-ChildItem $PSScriptRoot -Filter "*.ps1" |
Sort-Object { $_.BaseName } |
Foreach-Object -Process {
Write-DisplayHelp -Name $_.FullName -HelpSynopsis -DontExit
}
}
catch [System.Exception]
{
Write-DisplayError $PSItem.ToString() -Exit
}
}
End
{
}