You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A version part too large for Int64 ends Test-IntuneAssignmentFilter with a conversion error #106
A version in an assignment filter rule with a part too large for a 64-bit integer ends Test-IntuneAssignmentFilter with a conversion error, where it should return a verdict.
Reproduction
On main (3b82ba2), under PowerShell 7.6 and Windows PowerShell 5.1:
The command ends with InvalidCastFromStringToInteger,Test-IntuneAssignmentFilter: Cannot convert value "99999999999999999999" to type "System.Int64". The same happens when the device's version has such a part.
Expected
The text is not a version the evaluator can order, so -gt, -ge, -lt and -le do not match, as they already do not for any other text that is not a version. The command returns Matched = $false.
Cause
The version reader accepts any number of digits in a part (^\s*\d+(\.\d+){0,3}\s*$) and then casts each part with [long]$part, which throws on overflow. The code is the nested Get-VersionPart of Test-IntuneAssignmentFilter on main and Get-IslVersionPart on the #65 branches.
This is not a finding against ai-powershell-standards 2.0.0. It was found in a review of #102.
Activity