Skip to content

Commit

Permalink
Add information on Generate-FindCommandIndex and update existing scri…
Browse files Browse the repository at this point in the history
…pts information
  • Loading branch information
FH-Inway committed Feb 11, 2024
1 parent 9b94650 commit ae2d1c5
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions wiki/Building-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@ To run the scripts locally, follow the instructions below.
* `Install-Module platyPS -Force -Confirm:$false`

## **Format Comment Based help**
We try to keep the formatting of the Comment Based Help the same across every contributor, so here is the base script on [gist](https://gist.github.com/Splaxi/ff7485a24f6ed9937f3e8da76b5d4840).

You need to work a little with the path to the folder, but otherwise it is as simple as copy & pasting the content into a new powershell console or simply execute the ps1 file directly. When you create a local git repository on your machine, you need to adjust the path from the gist. You should adjust the **"C:\GITHUB\LocalRepository\"** part of the path to match where your local repository is stored. Then rest should work as expected. You should store the file **OUTSIDE** the repo, so it doesn't become part of the project.
We try to keep the formatting of the Comment Based Help the same across every contributor. This is done by the [Format-CommentBasedHelp.ps1](https://github.com/d365collaborative/d365fo.tools/tree/development/build/format-commentbasedhelp.ps1) script. If you want to find out more about comment based help, take a look at [about Comment Based Help](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help).

## **Generate-ParameterUnitTests**
We try to mitigate the drifting changes that might get introduced when multiple people contribute to the same project. We also try to ensure that the parameters doesn't change **without** we knowing it. This helps us update the examples inside the Comment Based Help and therefor the user base. Find the base script on [gist](https://gist.github.com/Splaxi/2a24fc3c5193089ae7047ac5b8f104db).

You need to work a little with the path to the folder, but otherwise it is as simple as copy & pasting the content into a new powershell console or simply execute the ps1 file directly. When you create a local git repository on your machine, you need to adjust the path from the gist. You should adjust the **"C:\GITHUB\LocalRepository\"** part of the path to match where your local repository is stored. Then rest should work as expected. You should store the file **OUTSIDE** the repo, so it doesn't become part of the project.
We try to mitigate the drifting changes that might get introduced when multiple people contribute to the same project. We also try to ensure that the parameters do not change **without** us knowing about it. This helps us update the examples inside the Comment Based Help and therefor the user base. This is done by the [Generate-ParameterUnitTests.ps1](https://github.com/d365collaborative/d365fo.tools/tree/development/build/generate-parameterunittests.ps1) script. This script will generate a new test file for each command in the module, using the `Invoke-PSMDTemplate` cmdlet of [PSModuleDevelopment](https://github.com/PowershellFrameworkCollective/PSModuleDevelopment). The tests will check a list of best practices.

## **Update-Docs**
Whenever we release a new version of the module, we push the updated markdown files used for documentation, to make sure that users can lookup parameter names and parameterset specification. Find the base script on [gist](https://gist.github.com/Splaxi/8934e13cb35918d13af6e3a21c208b0e).
Whenever we release a new version of the module, we push the updated markdown files used for documentation, to make sure that users can lookup parameter names and parameterset specification. This is done by the [Update-Docs.ps1](https://github.com/d365collaborative/d365fo.tools/tree/development/build/update-docs.ps1) script. The markdown files are created from the Comment Based Help in the module. The `New-MarkdownHelp` cmdlet of [platyPS](https://learn.microsoft.com/en-us/powershell/utility-modules/platyps/overview) is used to create the markdown files.

You need to work a little with the path to the folder, but otherwise it is as simple as copy & pasting the content into a new powershell console or simply execute the ps1 file directly. When you create a local git repository on your machine, you need to adjust the path from the gist. You should adjust the **"C:\GITHUB\LocalRepository\"** part of the path to match where your local repository is stored. Then rest should work as expected. You should store the file **OUTSIDE** the repo, so it doesn't become part of the project.
## **Generate-FindCommandIndex**
The [Find-D365Command](Find-D365Command.md) is used to find commands in the module. It acts faster than the built-in Get-Help cmdlet, but it requires a file to be updated whenever a new command is added to the module. This script will update the file with the new command. Find the script in the build folder of the repository: [Generate-FindCommandIndex.ps1](https://github.com/d365collaborative/d365fo.tools/tree/development/build/Generate-FindCommandIndex.ps1).

## **Closing notes**
The reason why we keep these steps manual for the time being is to make sure that nothing gets updated without we either knowing about it or without us making a "decision" to update these things.

0 comments on commit ae2d1c5

Please sign in to comment.