Thank you for looking. Issues and pull requests are welcome.
- A rule fires on something Intune tolerates, or misses something it does not: that is the
most useful issue this project can get. Open one with the script (or a cut-down version that
still shows it), the script type, and what Intune actually did on a device. Every rule cites its
Evidence, ending in experiment ids such asREM-EXIT-2; those are the entries inValidation/Experiments.psd1whose resultsValidation/Findings.mdrecords, so say which finding you think is wrong. - A harness result that differs from the portal: include
-Verboseoutput and the result object.OutputandExitCodeon it are the values Intune reports; the portal only formats them. - A change: open an issue first if it is more than a fix, so the shape can be agreed before
the work.
CLAUDE.mdlists the invariants that look arbitrary until you know the reason.
General PowerShell conventions - module layout, comment-based help, Pester, error handling - are
mirrored into .github/ from
ai-powershell-standards. Those paths are
overwritten on every sync, so a change to a convention belongs upstream.
Everything specific to this module is in CLAUDE.md. The ones most often tripped over:
- A rule is backed by what a device did, not by what a document says. A new rule needs an
experiment in
Validation/Experiments.psd1, a run recorded inValidation/Findings.md, and the experiment ids in itsEvidence. - Only exported functions carry
.EXTERNALHELP; their help lives indocs/and is compiled toen-US/IntuneScriptLab-Help.xmlbyBuild/Build-Help.ps1. Rebuild it in the same change as a docs edit; the help gate compares byte for byte. docs/Rules.mdis generated byBuild/Build-RuleReference.ps1and a unit test keeps it current. Rebuild it after changing a rule's message, severity or evidence.- A new command goes in the manifest, the
Export-ModuleMemberlist in the root module, the contract test, anddocs/. - Windows PowerShell 5.1 and PowerShell 7 both have to work, so nothing 7-only anywhere the module loads. The suites run on 5.1 and on Windows on ARM in CI.
Invoke-Pester ./Tests, ./Validation/Tests # a few minutes; suites needing elevation,
# a lab account or PSScriptAnalyzer skip themselves
Invoke-ScriptAnalyzer -Path . -Recurse -Severity Error, Warning -ExcludeRule PSAvoidLongLines
./Build/Build-Help.ps1 # after editing docs/
./Build/Build-RuleReference.ps1 # after changing a rule
./Build/Publish-Module.ps1 -WhatIf # the full release rehearsalRun the unit suites under Windows PowerShell 5.1 as well:
powershell -NoProfile -Command "Invoke-Pester ./Tests/Unit, ./Validation/Tests/Unit"The suites reach no tenant: every Graph call goes through a mocked seam. A change to what a rule
or the harness claims about Intune should also be run against a device you own, and the pull
request should say what you ran and what it did. The validation kit under Validation/ is how
the existing evidence was produced; it needs a tenant and lab devices of your own and its README
explains the rounds.
- One rule, one command or one concern per pull request.
- Add or update the tests that pin the behaviour, and a line in
CHANGELOG.mdunder[Unreleased]. - The quality gates run on every pull request on PowerShell 7, Windows PowerShell 5.1, Windows on ARM, and a case-sensitive filesystem for the help.