Skip to content

Commit 5e6cec4

Browse files
committed
updated readme for enums + arg completions
1 parent 9e5898d commit 5e6cec4

1 file changed

Lines changed: 74 additions & 2 deletions

File tree

README.md

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ Use this template to quickly bootstrap new PowerShell module projects with indus
1515
- Dependency management with PSDepend
1616
- GitHub Actions CI/CD workflows
1717
- C# class support
18+
- Enum support with automatic loading
19+
- Argument completer support
1820
- Automatic documentation
21+
- Optional GitHub Pages site generation
1922

2023
## Getting Started
2124

@@ -25,7 +28,6 @@ Use this template to quickly bootstrap new PowerShell module projects with indus
2528
- [Make](https://gnuwin32.sourceforge.net/packages/make.htm)
2629
- [PowerShell Core](https://learn.microsoft.com/en-us/powershell/scripting/install/install-powershell-on-windows)
2730

28-
2931
### Using This Template
3032

3133
Click the '[Use this template](https://github.com/jdarcyryan/PSModuleTemplate/generate)' button at the top of this repository to create a new repository based on this template.
@@ -71,6 +73,52 @@ This runs all pester tests against the built module.
7173
make pester
7274
```
7375

76+
## Module Structure
77+
78+
The module loads in this order: **classes → enums → private → public → completers**.
79+
80+
### Classes
81+
82+
Defined in `classes/` and loaded in the order specified in `classes/classes.psd1`. Order matters — parent classes must be listed before children. Supports `.ps1`, `.cs`, and `.dll` files.
83+
84+
### Enums
85+
86+
Defined in `enums/` as `.ps1` files and loaded automatically.
87+
88+
```powershell
89+
# enums/LogLevel.ps1
90+
enum LogLevel {
91+
Debug
92+
Info
93+
Warning
94+
Error
95+
Critical
96+
}
97+
```
98+
99+
### Private Functions
100+
101+
Defined in `private/`, one function per file. Available within the module but not exported.
102+
103+
### Public Functions
104+
105+
Defined in `public/`, one function per file, using the `Verb-Noun` convention. To export these functions, they must be included in the `FunctionsToExport` array inside the module manifest.
106+
107+
### Argument Completers
108+
109+
Defined in `completers/` and loaded last. Provide tab-completion for function parameters. Use an underscore naming convention (e.g. `Complete_ParameterName.ps1`) — they are excluded from Pester naming and help tests.
110+
111+
```powershell
112+
# completers/Complete_LogLevel.ps1
113+
Register-ArgumentCompleter -CommandName 'Write-Log' -ParameterName 'Level' -ScriptBlock {
114+
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters)
115+
116+
[LogLevel].GetEnumNames() | where { $_ -like "$wordToComplete*" } | foreach {
117+
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
118+
}
119+
}
120+
```
121+
74122
## Dependencies
75123

76124
Module dependencies are managed using [PSDepend](https://github.com/RamblingCookieMonster/PSDepend).
@@ -135,6 +183,30 @@ To use this workflow:
135183
After merging to master, markdown files for each public function in the module will be created.
136184
Ensure Get-Help is accurate and populated, as this will be referenced to create the documentation.
137185

186+
## GitHub Pages
187+
188+
This template includes a workflow that can automatically generate a documentation site for your module using GitHub Pages. The site is built from your repository's markdown files and includes your README as the homepage, exported command documentation, releases fetched from the GitHub API, and any LICENSE, CONTRIBUTING, or CODE_OF_CONDUCT files.
189+
190+
### Enabling GitHub Pages
191+
192+
1. Go to **Settings****Pages** in your repository.
193+
2. Under **Build and deployment**, set the source to **GitHub Actions**.
194+
3. Push to `main` or manually trigger the workflow from the **Actions** tab.
195+
196+
The site will be published at `https://<owner>.github.io/<repo>/`.
197+
198+
### What gets included
199+
200+
The Pages workflow only publishes markdown files (`.md`), license files (`LICENSE`, `LICENSE.txt`), and image assets from the `assets/` folder. Everything else in your repository (source code, build scripts, tests, etc.) is excluded.
201+
202+
### Favicon
203+
204+
To add a favicon to your site, place an SVG file at `assets/favicon.svg` in your repository.
205+
206+
### How it works
207+
208+
The workflow dynamically generates the site at build time — no Jekyll configuration files need to be committed to your repository. It detects which community files exist (LICENSE, CONTRIBUTING, CODE_OF_CONDUCT) and conditionally adds them to the navigation. If GitHub Pages is not enabled, the workflow skips gracefully without failing.
209+
138210
## Contributing
139211

140212
We welcome contributions! Please see [CONTRIBUTING](CONTRIBUTING.md) for details on how to contribute to this project.
@@ -153,4 +225,4 @@ Copyright (c) 2026 James D'Arcy Ryan
153225

154226
## Acknowledgments
155227

156-
Thank you to all contributors who help improve this template!
228+
Thank you to all contributors who help improve this template!

0 commit comments

Comments
 (0)