Skip to content

refactor(helpers): move the assignment filter's evaluator out - #102

Open
fadwen wants to merge 4 commits into
refactor/helpers-logs-graphfrom
refactor/helpers-filter
Open

fadwen wants to merge 4 commits into
refactor/helpers-logs-graphfrom
refactor/helpers-filter

Conversation

@fadwen

@fadwen fadwen commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

The third part of #65. The four functions nested in Test-IntuneAssignmentFilter are private functions in files of their own, each an advanced function with full comment-based help and an output type. They take the device's facts as a parameter where they read them from the command. Behaviour does not change.

Stacked on #101, which is stacked on #100.

Changes

Was Now Notes
Get-VersionPart Get-IslVersionPart
Compare-Version Compare-IslFilterVersion
Test-Clause Test-IslFilterClause -Facts; -Clause declares the type IntuneScriptLab.FilterClause
Test-Node Test-IslFilterNode -Facts
  • The clause is still changed in place: Actual and Matched are set on it, so that the result object of the command shows what each clause saw. The help of Test-IslFilterClause says so.
  • Tests: a file for each new function under Tests/Unit/Private. The clauses and trees in them are built by the module's own parser, as the command builds them: every operator, a version comparison, a property the device does not have, and that both sides of and and or are tested so every clause records its result. The command's tests are unchanged and pass.
  • The CHANGELOG entry of refactor(helpers): move four nested helpers into their own files #100 names the command.

Verification

Notes

  • Version comparisons with -gt, -ge, -lt and -le are allowed on device.operatingSystemVersion and refused by the parser on device.osVersion; the tests use the first, as the command's own tests do.

The third part of #65. The four functions nested in
Test-IntuneAssignmentFilter are private functions in files of their
own, advanced functions with full help and output types:

- Get-VersionPart -> Get-IslVersionPart
- Compare-Version -> Compare-IslFilterVersion
- Test-Clause -> Test-IslFilterClause, with the device's facts as
  -Facts where it read them from the command
- Test-Node -> Test-IslFilterNode, with -Facts as well

The clause keeps being changed in place, so that the result of the
command still shows what each clause saw. Each new function has a
test file of its own; the command's tests are unchanged.

Refs #65.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant