Repository navigation
Conversation
The fifth part of #65. The four functions nested in Invoke-IntuneWin32AppTest are private functions in files of their own, advanced functions with full help and output types. They take as parameters what they read from the command: - Invoke-DetectionPass -> Invoke-IslWin32DetectionPass, with the detection settings as -Detection and the warning list as -Warning - Invoke-ContentCommand -> Invoke-IslWin32ContentCommand, with -Context, -Credential, -TimeoutSeconds and -Warning - Get-Outcome -> Get-IslWin32Outcome, with -ReturnCodes - ConvertTo-RelatedResult -> ConvertTo-IslWin32RelatedResult The command passes the shared values through two splats. The two that launch something end with the error of a step that could not be run, inside a catch of their own, where the nested copies relied on the command's try. A detection pass now carries the type name IntuneScriptLab.Win32DetectionPass. Each new function has a test file of its own; the command's tests are unchanged. Refs #65.
This was referenced Nov 24, 2026
Invoke-IslWin32DetectionPass filtered null entries out of -Rule. A dependency or superseded app whose DetectionRule held only nulls passed the command's upfront check, since a list of two nulls is true, and its pass then had no script and no rules, which reads as detected: the dependency was reported Installed without being checked or installed. The nested function this replaced passed each entry to Test-IntuneWin32Rule, which refused the null. A null entry now ends the pass with DetectionRuleEmpty, and a pass with neither a script nor a rule ends with DetectionMissing.
This was referenced Nov 25, 2026
Collaborator
|
183aa88 fixes a regression in this pull request.
The branch also takes the fixes merged up from #100 and #101. 🤖 Generated with Claude Code |
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 fifth part of #65. The four functions nested in
Invoke-IntuneWin32AppTestare private functions in files of their own, each an advanced function with full comment-based help and an output type. They take as parameters what they used to read from the command. Behaviour does not change.Stacked on #103, #102, #101 and #100.
Changes
Invoke-DetectionPassInvoke-IslWin32DetectionPass-Detection, the settings every detection shares, and-Warning, the run's warning listInvoke-ContentCommandInvoke-IslWin32ContentCommand-Context,-Credential,-TimeoutSecondsand-WarningGet-OutcomeGet-IslWin32Outcome-ReturnCodesConvertTo-RelatedResultConvertTo-IslWin32RelatedResult$passSplatand$contentSplat, and passes them to every pass and every install or uninstall.catchof their own; the nested copies relied on the command'stry, which the error-flow test accepted only because they were nested. The detection inside a pass is still called with-ErrorAction Stop, for the reason fix(harness)!: raise run failures as terminating errors with IDs #92 gave: with nothing returned, the app would read as detected.IntuneScriptLab.Win32DetectionPass; it is internal and never returned to a caller. AndGet-IslWin32Outcomegivesfailedfor a run that has no exit code and did not time out, where the nested copy looked up a null key and would have failed with an error; no run reaches it that way today.powershell.exe, and a content folder that is not there. The command's own tests are unchanged and pass.Verification
./Tests/Invoke-Tests.ps1 -CodeCoverageon PowerShell 7.6.10: 1,334 passed, 7 skipped, 95.26 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,298 passed, 43 skipped, the same 3 failed.NT AUTHORITY\SYSTEMunder Windows PowerShell 5.1.26100.9818, every suite: 1,297 passed, 0 failed, 47 skipped (they need PowerShell 7, PSScriptAnalyzer or the Proxmox host). The Win32 workflow and the runs as another account were among those that ran; the credential reaches the content command through a new parameter, which is why this one went to the lab.Get-Helpfinds the help of each of the four functions. CI's analysis step locally: 0 findings, no line over 115 characters. The standards' check finds nothing in the four new files.quality-gates.yml, started by hand on this branch because the pull request is not based onmain.