Skip to content

fix(filter): read a version part too large for Int64 as no version - #108

Open
fadwen-ai wants to merge 2 commits into
fix/settings-severity-tablefrom
fix/filter-version-overflow
Open

fadwen-ai wants to merge 2 commits into
fix/settings-severity-tablefrom
fix/filter-version-overflow

Conversation

@fadwen-ai

@fadwen-ai fadwen-ai commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A version in an assignment filter with a part too large for a 64-bit number, such as 10.0.99999999999999999999 in a rule or in the device's operatingSystemVersion, ended Test-IntuneAssignmentFilter with InvalidCastFromStringToInteger. Such a text is now not a version, like any other text the evaluator cannot order, so -gt, -ge, -lt and -le do not match it and the command returns a verdict.

Closes #106

Changes

  • Get-IslVersionPart reads each part with [long]::TryParse and gives nothing when a part does not fit, as it already does for a text that is not a version. The help says so.
  • Tests: the helper reads 9223372036854775807 and gives nothing for a part one digit past it; Test-IntuneAssignmentFilter returns Matched = $false for such a version in the rule and on the device.
  • CHANGELOG: an entry under Fixed.

Verification

  • Every suite on the top of the stack (fix/filter-version-overflow, which holds both fixes), ./Tests/Invoke-Tests.ps1 under PowerShell 7: 1,349 passed, 3 failed, 7 skipped. The unit suites under Windows PowerShell 5.1: 1,262 passed, 2 failed, 37 skipped. The failures are the host-dependent tests of Repair-IntuneScript corrupts an ANSI script on a host with a UTF-8 system code page #75 and In-box module table does not list UOPProviders, present on Windows 11 26H2 #76, on a host whose system code pages are UTF-8; they pass in CI.
  • The tests this change touches, on both versions: all passed.
  • PSScriptAnalyzer with CI's settings: 0 findings. No line over 115 characters in a changed .ps1 file.
  • ./Build/Publish-Module.ps1 -WhatIf: the staged module imports, exports its commands, analyzes a sample and serves its help; nothing published.
  • quality-gates.yml, started by hand on this branch because the pull request is not based on main: run 45521796334, which passed all five jobs.

Notes

🤖 Generated with Claude Code

Get-IslVersionPart accepted any number of digits in a part and cast it
with [long], which throws on overflow, so a filter rule or a device
version such as 10.0.99999999999999999999 ended
Test-IntuneAssignmentFilter with a conversion error. Such a text is now
not a version, like any other text the evaluator cannot order, and the
ordering operators do not match it.

Closes #106
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.

2 participants