Skip to content

Commit f06d02a

Browse files
committed
add categories to config files
1 parent 5763b26 commit f06d02a

12 files changed

+758
-219
lines changed

Get-CustomConfigurationHelp.ps1

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<#
2+
.SYNOPSIS
3+
Shows help summary for all Custom Configuration scripts.
4+
5+
.DESCRIPTION
6+
Shows help summary for all Custom Configuration scripts.
7+
8+
.INPUTS
9+
None.
10+
11+
.OUTPUTS
12+
None.
13+
14+
.EXAMPLE
15+
PS> .\Get-CustomConfigurationHelp
16+
#>
17+
18+
<#
19+
.BASEPARAMETERS Silent
20+
21+
.TODO
22+
#>
23+
#Requires -Version 5.0
24+
#Requires -Modules Varan.PowerShell.Base
25+
#Requires -Modules Varan.PowerShell.Common
26+
#Requires -Modules Varan.PowerShell.Validation
27+
using module Varan.PowerShell.Validation
28+
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
29+
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'None')]
30+
param (
31+
)
32+
DynamicParam { Build-BaseParameters }
33+
34+
Begin
35+
{
36+
Write-LogTrace "Execute: $(Get-RootScriptName)"
37+
$minParams = Get-MinimumRequiredParameterCount -CommandInfo (Get-Command $MyInvocation.MyCommand.Name)
38+
$cmd = @{}
39+
40+
if(Get-BaseParamHelpFull) { $cmd.HelpFull = $true }
41+
if((Get-BaseParamHelpDetail) -Or ($PSBoundParameters.Count -lt $minParams)) { $cmd.HelpDetail = $true }
42+
if(Get-BaseParamHelpSynopsis) { $cmd.HelpSynopsis = $true }
43+
44+
if($cmd.Count -gt 1) { Write-DisplayHelp -Name "$(Get-RootScriptPath)" -HelpDetail }
45+
if($cmd.Count -eq 1) { Write-DisplayHelp -Name "$(Get-RootScriptPath)" @cmd }
46+
}
47+
Process
48+
{
49+
try
50+
{
51+
$scriptCol = "$('Script'.PadRight(38, ' '))"
52+
$aliasCol = "$('Alias'.PadRight(16, ' '))"
53+
$descCol = 'Description'
54+
Write-DisplayHost "$scriptCol$aliasCol$descCol" -Style HelpItem
55+
56+
Get-ChildItem $PSScriptRoot -Filter "*.ps1" |
57+
Sort-Object { $_.BaseName } |
58+
Foreach-Object -Process {
59+
Write-DisplayHelp -Name $_.FullName -HelpSynopsis -DontExit
60+
}
61+
62+
}
63+
catch [System.Exception]
64+
{
65+
Write-DisplayError $PSItem.ToString() -Exit
66+
}
67+
}
68+
End
69+
{
70+
}
+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<#
2+
.SYNOPSIS
3+
Show script version.
4+
5+
.DESCRIPTION
6+
Show script version.
7+
8+
.INPUTS
9+
None.
10+
11+
.OUTPUTS
12+
None.
13+
14+
.EXAMPLE
15+
PS> .\Get-CustomConfigurationScriptVersion.ps1
16+
#>
17+
using module Varan.PowerShell.Validation
18+
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
19+
#Requires -Version 5.0
20+
#Requires -Modules Varan.PowerShell.Validation
21+
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'None')]
22+
param (
23+
)
24+
DynamicParam { Build-BaseParameters }
25+
26+
Begin
27+
{
28+
Write-LogTrace "Execute: $(Get-RootScriptName)"
29+
$minParams = Get-MinimumRequiredParameterCount -CommandInfo (Get-Command $MyInvocation.MyCommand.Name)
30+
$cmd = @{}
31+
32+
if(Get-BaseParamHelpFull) { $cmd.HelpFull = $true }
33+
if((Get-BaseParamHelpDetail) -Or ($PSBoundParameters.Count -lt $minParams)) { $cmd.HelpDetail = $true }
34+
if(Get-BaseParamHelpSynopsis) { $cmd.HelpSynopsis = $true }
35+
36+
if($cmd.Count -gt 1) { Write-DisplayHelp -Name "$(Get-RootScriptPath)" -HelpDetail }
37+
if($cmd.Count -eq 1) { Write-DisplayHelp -Name "$(Get-RootScriptPath)" @cmd }
38+
}
39+
Process
40+
{
41+
try
42+
{
43+
$isDebug = Assert-Debug
44+
45+
$mcPath = $PSScriptRoot
46+
$mcver = $mcPath + "\version.txt"
47+
48+
if(Test-Path $mcver)
49+
{
50+
Get-Content $mcver | ForEach { Write-Host "Version $_" -ForegroundColor Yellow }
51+
}
52+
else
53+
{
54+
WriteError "Unable to find version file: ${mcver}"
55+
}
56+
}
57+
catch [System.Exception]
58+
{
59+
Write-DisplayError $PSItem.ToString() -Exit
60+
}
61+
}
62+
End
63+
{
64+
Write-DisplayHost "Done." -Style Done
65+
}
66+
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)