Repository navigation
Conversation
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.
This was referenced Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The third part of #65. The four functions nested in
Test-IntuneAssignmentFilterare 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
Get-VersionPartGet-IslVersionPartCompare-VersionCompare-IslFilterVersionTest-ClauseTest-IslFilterClause-Facts;-Clausedeclares the typeIntuneScriptLab.FilterClauseTest-NodeTest-IslFilterNode-FactsActualandMatchedare set on it, so that the result object of the command shows what each clause saw. The help ofTest-IslFilterClausesays so.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 ofandandorare tested so every clause records its result. The command's tests are unchanged and pass.Verification
./Tests/Invoke-Tests.ps1 -CodeCoverageon PowerShell 7.6.10: 1,277 passed, 7 skipped, 95.29 percent coverage. 3 failed, the three that fail on this computer onmainas well (Repair-IntuneScript corrupts an ANSI script on a host with a UTF-8 system code page #75 twice, In-box module table does not list UOPProviders, present on Windows 11 26H2 #76)../Tests/Invoke-Tests.ps1on Windows PowerShell 5.1.26100: 1,241 passed, 43 skipped, the same 3 failed.Get-Helpfinds the help of each of the four functions.Test-IntuneAssignmentFilter.ps1are gone.quality-gates.yml, started by hand on this branch because the pull request is not based onmain: run 45504240841 passed all five jobs.Notes
-gt,-ge,-ltand-leare allowed ondevice.operatingSystemVersionand refused by the parser ondevice.osVersion; the tests use the first, as the command's own tests do.