You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documentation for the cmdlets in the Chocolatey.PowerShell project is maintained as `*.md` files in the [chocolatey/docs](https://github.com/chocolatey/docs) repository, under `input/en-us/create/cmdlets`.
159
+
When making changes to a cmdlet or adding a new one, we need to ensure that those Markdown files get updated, and that those changes are propagated back to this repository in the [`Chocolatey.PowerShell.dll-help.xml`](./src/Chocolatey.PowerShell/Chocolatey.PowerShell.dll-Help.xml) file in the repository.
160
+
161
+
Before working with this, be sure to clone the `chocolatey/docs` repository locally.
162
+
If your local copy of the docs repository is not located at `../docs` relative to this folder, you will need to specify the `-DocsRepositoryPath` parameter whenever calling the `update-cmdlet-documentation.ps1` script.
163
+
164
+
### Generating Documentation for a new Cmdlet
165
+
166
+
Run the `update-cmdlet-documentation.ps1` script with the `-NewCommand` parameter, specifying the name of the cmdlet(s) that you've added:
Once this completes, you will get a warning that the documentation template needs to be filled out and the newly-generated documentation file will open in your default editor for `*.md` files.
173
+
174
+
### Updating Documentation For an Existing Cmdlet
175
+
176
+
Run the `update-cmdlet-documentation.ps1` script:
177
+
178
+
```powershell
179
+
./update-cmdlet-documentation.ps1
180
+
```
181
+
182
+
### Generating the `Chocolatey.PowerShell.dll-help.xml` External Help Documentation
183
+
184
+
Once new files have been generated, in the `chocolatey/docs` repository, make any additional changes needed to the files.
185
+
Note that these files will need to be compatible both with PlatyPS and the docs repository Markdown formatting.
186
+
As such, for new files you will need to sure the additional frontmatter is added.
187
+
A complete frontmatter block for these files looks like this:
188
+
189
+
```md
190
+
---
191
+
Description: Information on Cmdlet-Name cmdlet
192
+
external help file: Chocolatey.PowerShell.dll-Help.xml
Some files may also have a `RedirectFrom: [ ... ]` frontmatter entry.
203
+
This is not required for new files, but existing files (or files added for a cmdlet that is a rewrite of a pre-existing command) should retain their existing redirects.
204
+
205
+
Run the `update-cmdlet-documentation.ps1` script once more, and add the changes to the `Chocolatey.PowerShell.dll-help.xml` file to a commit.
206
+
207
+
Finally, add the changes to a commit on a new branch in the `docs` repository and submit a PR for any changes there as well, alongside the PR to any changes made in this repository.
208
+
If you are rewriting a cmdlet from a pre-existing script command, ensure you remove the old documentation file from `input/en-us/create/commands` as well, so that there are no duplicate xrefs.
0 commit comments