Example Authoring
The authoring contract for every file under Examples/Resources/ is
.github/instructions/m365dsc-examples.instructions.md. Read it in full before editing an example,
and follow it exactly.
Steps
- Read
.github/instructions/m365dsc-examples.instructions.md. - Read the resource class at
Modules/Microsoft365DSC/DscResources/MSFT_<Name>/MSFT_<Name>.psm1to get the property set, the[ValidateSet]members and the complex types. - Read the three example files before changing any of them.
- Edit
1-Create.ps1and2-Update.ps1. Leave3-Remove.ps1alone unless it carries a property outside the allowed set. - Verify with the analyzer and the two Pester gates named in the contract.
Constraints
- Preserve CRLF line endings and any byte-order mark. Read and write with
[System.IO.File]::ReadAllTextandWriteAllTextusing aUTF8Encodingwhose BOM flag matches the original. Never usesed -i. - Keys stay byte-identical across every file in the folder.
- Do not create or delete files.