Skip to content

Commit e8a3982

Browse files
committed
Generated Docs. Fixed build script and ci workflow
1 parent 6c8a11d commit e8a3982

23 files changed

Lines changed: 1486 additions & 17 deletions

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
2323
- name: Run build
2424
shell: pwsh
25-
run: pwsh ./build.ps1
25+
run: pwsh ./Scripts/build.ps1

‎Analyzer/PSScriptAnalyzerSettings.psd1‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,23 @@
1212
PSProvideCommentHelp = @{
1313
Severity = 'Information'
1414
}
15+
PSAvoidUsingCmdletAliases = @{
16+
Severity = 'Warning'
17+
}
18+
PSAvoidUsingPositionalParameters = @{
19+
Severity = 'Information'
20+
}
21+
PSUseApprovedVerbs = @{
22+
Severity = 'Warning'
23+
}
24+
PSUseConsistentWhitespace = @{
25+
Severity = 'Information'
26+
}
27+
PSUseConsistentIndentation = @{
28+
Severity = 'Information'
29+
}
30+
PSAvoidTrailingWhitespace = @{
31+
Severity = 'Information'
32+
}
1533
}
1634
}

‎Docs/Initialize-GitRepository.md‎

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
external help file: NewModuleTemplate-help.xml
3+
Module Name: NewModuleTemplate
4+
online version:
5+
schema: 2.0.0
6+
---
7+
8+
# Initialize-GitRepository
9+
10+
## SYNOPSIS
11+
Initializes a new Git repository inside a module folder.
12+
13+
## SYNTAX
14+
15+
```
16+
Initialize-GitRepository [-ModulePath] <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]
17+
```
18+
19+
## DESCRIPTION
20+
Creates a .gitignore file, initializes a Git repository, stages all files,
21+
and performs an initial commit.
22+
This function is used by New-ModuleTemplate
23+
when the -InitGit switch is provided.
24+
25+
## EXAMPLES
26+
27+
### EXAMPLE 1
28+
```
29+
Initialize-GitRepository -ModulePath "C:\Projects\MyModule"
30+
```
31+
32+
### EXAMPLE 2
33+
```
34+
$root = "C:\Modules\Tools"
35+
Initialize-GitRepository -ModulePath $root
36+
```
37+
38+
## PARAMETERS
39+
40+
### -ModulePath
41+
The root directory of the module where the Git repository should be created.
42+
This must be the module's top-level folder (e.g., C:\Projects\MyModule).
43+
44+
```yaml
45+
Type: String
46+
Parameter Sets: (All)
47+
Aliases:
48+
49+
Required: True
50+
Position: 1
51+
Default value: None
52+
Accept pipeline input: False
53+
Accept wildcard characters: False
54+
```
55+
56+
### -ProgressAction
57+
{{ Fill ProgressAction Description }}
58+
59+
```yaml
60+
Type: ActionPreference
61+
Parameter Sets: (All)
62+
Aliases: proga
63+
64+
Required: False
65+
Position: Named
66+
Default value: None
67+
Accept pipeline input: False
68+
Accept wildcard characters: False
69+
```
70+
71+
### CommonParameters
72+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
73+
74+
## INPUTS
75+
76+
## OUTPUTS
77+
78+
## NOTES
79+
- Requires Git to be installed and available in PATH.
80+
- This function performs a commit with the message "Initial commit".
81+
82+
## RELATED LINKS

‎Docs/New-AnalyzerSettings.md‎

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
external help file: NewModuleTemplate-help.xml
3+
Module Name: NewModuleTemplate
4+
online version:
5+
schema: 2.0.0
6+
---
7+
8+
# New-AnalyzerSettings
9+
10+
## SYNOPSIS
11+
Generates a PSScriptAnalyzer settings file for the module.
12+
13+
## SYNTAX
14+
15+
```
16+
New-AnalyzerSettings [-ModulePath] <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]
17+
```
18+
19+
## DESCRIPTION
20+
Creates a PSScriptAnalyzer settings file inside the module's AnalyzerSettings
21+
directory.
22+
The file defines rule severities and allows the module to enforce
23+
consistent linting behavior across development environments and CI pipelines.
24+
25+
## EXAMPLES
26+
27+
### EXAMPLE 1
28+
```
29+
New-AnalyzerSettings -ModulePath "C:\Projects\MyModule"
30+
```
31+
32+
### EXAMPLE 2
33+
```
34+
$root = Join-Path $env:TEMP "TestModule"
35+
New-AnalyzerSettings -ModulePath $root
36+
```
37+
38+
## PARAMETERS
39+
40+
### -ModulePath
41+
The root directory of the module where the AnalyzerSettings folder exists.
42+
This is typically the path returned by New-ModuleFolders.
43+
44+
```yaml
45+
Type: String
46+
Parameter Sets: (All)
47+
Aliases:
48+
49+
Required: True
50+
Position: 1
51+
Default value: None
52+
Accept pipeline input: False
53+
Accept wildcard characters: False
54+
```
55+
56+
### -ProgressAction
57+
{{ Fill ProgressAction Description }}
58+
59+
```yaml
60+
Type: ActionPreference
61+
Parameter Sets: (All)
62+
Aliases: proga
63+
64+
Required: False
65+
Position: Named
66+
Default value: None
67+
Accept pipeline input: False
68+
Accept wildcard characters: False
69+
```
70+
71+
### CommonParameters
72+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
73+
74+
## INPUTS
75+
76+
## OUTPUTS
77+
78+
## NOTES
79+
This function is automatically invoked by New-ModuleTemplate.
80+
The settings file created is named PSScriptAnalyzerSettings.psd1.
81+
82+
## RELATED LINKS

‎Docs/New-BuildScript.md‎

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
external help file: NewModuleTemplate-help.xml
3+
Module Name: NewModuleTemplate
4+
online version:
5+
schema: 2.0.0
6+
---
7+
8+
# New-BuildScript
9+
10+
## SYNOPSIS
11+
Creates a build.ps1 script inside the generated module.
12+
13+
## SYNTAX
14+
15+
```
16+
New-BuildScript [-ModulePath] <String> [-Name] <String> [-ProgressAction <ActionPreference>]
17+
[<CommonParameters>]
18+
```
19+
20+
## DESCRIPTION
21+
Generates a build script that performs common module maintenance tasks:
22+
- Runs PSScriptAnalyzer using the module's analyzer settings
23+
- Executes Pester tests
24+
- Regenerates PlatyPS documentation
25+
The script supports switches to skip individual steps.
26+
27+
## EXAMPLES
28+
29+
### EXAMPLE 1
30+
```
31+
New-BuildScript -ModulePath "C:\Projects\MyModule" -Name "MyModule"
32+
```
33+
34+
### EXAMPLE 2
35+
```
36+
$root = Join-Path $env:TEMP "TestModule"
37+
New-BuildScript -ModulePath $root -Name "TestModule"
38+
```
39+
40+
## PARAMETERS
41+
42+
### -ModulePath
43+
The root directory of the module where the Scripts folder will be created.
44+
45+
```yaml
46+
Type: String
47+
Parameter Sets: (All)
48+
Aliases:
49+
50+
Required: True
51+
Position: 1
52+
Default value: None
53+
Accept pipeline input: False
54+
Accept wildcard characters: False
55+
```
56+
57+
### -Name
58+
The name of the module.
59+
Used to reference the module manifest and display
60+
status messages inside the generated build script.
61+
62+
```yaml
63+
Type: String
64+
Parameter Sets: (All)
65+
Aliases:
66+
67+
Required: True
68+
Position: 2
69+
Default value: None
70+
Accept pipeline input: False
71+
Accept wildcard characters: False
72+
```
73+
74+
### -ProgressAction
75+
{{ Fill ProgressAction Description }}
76+
77+
```yaml
78+
Type: ActionPreference
79+
Parameter Sets: (All)
80+
Aliases: proga
81+
82+
Required: False
83+
Position: Named
84+
Default value: None
85+
Accept pipeline input: False
86+
Accept wildcard characters: False
87+
```
88+
89+
### CommonParameters
90+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
91+
92+
## INPUTS
93+
94+
## OUTPUTS
95+
96+
## NOTES
97+
- The Analyzer folder is intentionally named "Analyzer".
98+
- This script is automatically invoked by New-ModuleTemplate.
99+
100+
## RELATED LINKS

‎Docs/New-DocumentationScripts.md‎

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
external help file: NewModuleTemplate-help.xml
3+
Module Name: NewModuleTemplate
4+
online version:
5+
schema: 2.0.0
6+
---
7+
8+
# New-DocumentationScripts
9+
10+
## SYNOPSIS
11+
Creates a documentation update script for the module.
12+
13+
## SYNTAX
14+
15+
```
16+
New-DocumentationScripts [-ModulePath] <String> [-Name] <String> [-ProgressAction <ActionPreference>]
17+
[<CommonParameters>]
18+
```
19+
20+
## DESCRIPTION
21+
Generates a PowerShell script that updates PlatyPS-based Markdown help
22+
for the module.
23+
The script imports PlatyPS and calls Update-MarkdownHelp
24+
using the module's manifest and Docs folder.
25+
This allows developers to
26+
regenerate documentation after modifying public functions.
27+
28+
## EXAMPLES
29+
30+
### EXAMPLE 1
31+
```
32+
New-DocumentationScripts -ModulePath "C:\Projects\MyModule" -Name "MyModule"
33+
```
34+
35+
### EXAMPLE 2
36+
```
37+
$root = Join-Path $env:TEMP "TestModule"
38+
New-DocumentationScripts -ModulePath $root -Name "TestModule"
39+
```
40+
41+
## PARAMETERS
42+
43+
### -ModulePath
44+
The root directory of the module where the Scripts folder will be created.
45+
46+
```yaml
47+
Type: String
48+
Parameter Sets: (All)
49+
Aliases:
50+
51+
Required: True
52+
Position: 1
53+
Default value: None
54+
Accept pipeline input: False
55+
Accept wildcard characters: False
56+
```
57+
58+
### -Name
59+
The name of the module.
60+
Used to reference the module manifest inside the
61+
generated documentation update script.
62+
63+
```yaml
64+
Type: String
65+
Parameter Sets: (All)
66+
Aliases:
67+
68+
Required: True
69+
Position: 2
70+
Default value: None
71+
Accept pipeline input: False
72+
Accept wildcard characters: False
73+
```
74+
75+
### -ProgressAction
76+
{{ Fill ProgressAction Description }}
77+
78+
```yaml
79+
Type: ActionPreference
80+
Parameter Sets: (All)
81+
Aliases: proga
82+
83+
Required: False
84+
Position: Named
85+
Default value: None
86+
Accept pipeline input: False
87+
Accept wildcard characters: False
88+
```
89+
90+
### CommonParameters
91+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
92+
93+
## INPUTS
94+
95+
## OUTPUTS
96+
97+
## NOTES
98+
- The generated script is named Update-ModuleDocumentation.ps1.
99+
- PlatyPS must be installed for the script to run successfully.
100+
101+
## RELATED LINKS

0 commit comments

Comments
 (0)