Repository navigation
Conversation
The fourth part of #65. Six functions nested in Find-IslInteractiveCall, Find-IslExitCodeIssue and Find-IslModuleDependency are private functions in files of their own, advanced functions with full help and output types, cut from the rules with their bodies unchanged: - Get-CredentialArgument -> Get-IslCredentialArgument - Get-CredentialSource -> Get-IslCredentialSource - Get-VariableCredentialSource -> Get-IslVariableCredentialSource, with the script's tree as -Ast - Get-ReturnReplacement -> Get-IslReturnReplacement - Test-ExitFollowsReturn -> Test-IslExitFollowsReturn - Test-InBox -> Test-IslInboxModuleName, with the list as -InboxModule Write-Missing built a finding, and Build-RuleReference.ps1 reads the finding tables from the rule files only, so it stays in the rule as a loop over the modules the rule collected. docs/Rules.md regenerates unchanged. Each new function has a test file of its own; the rules' tests are unchanged. Refs #65.
This was referenced Nov 24, 2026
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 fourth part of #65. The seven helpers nested in three analyzer rules,
Find-IslInteractiveCall,Find-IslExitCodeIssueandFind-IslModuleDependency, are handled: six are private functions in files of their own, each an advanced function with full help and an output type, and the seventh, which built a finding, is folded into its rule. Behaviour does not change, anddocs/Rules.mdcomes out byte for byte the same.Stacked on #102, #101 and #100.
Changes
Get-CredentialArgumentinFind-IslInteractiveCallGet-IslCredentialArgument-CommandtypedCommandAstGet-CredentialSourceGet-IslCredentialSourceGet-VariableCredentialSourceGet-IslVariableCredentialSource-Ast, where it read$astfrom the ruleGet-ReturnReplacementinFind-IslExitCodeIssueGet-IslReturnReplacementTest-ExitFollowsReturnTest-IslExitFollowsReturnTest-InBoxinFind-IslModuleDependencyTest-IslInboxModuleName-InboxModuleWrite-MissinginFind-IslModuleDependencyWrite-Missingstays in the rule as a loop.Build/Build-RuleReference.ps1reads the finding tables of each rule from the files underPrivate/Rules. A finding built in a helper underPrivatewould have dropped out ofdocs/Rules.md. The rule now collects each module that is not in-box, with what named it and where, and one loop at the end builds the finding with the same table and the same variable names in its message../Build/Build-RuleReference.ps1regeneratesdocs/Rules.mdwith no change, andTests/Unit/RuleReference.Tests.ps1passes.elseifon its own line) inGet-IslCredentialSourceandGet-IslVariableCredentialSource; they are left for Source layout does not follow the standards and CI does not check it (STY-01, STY-02, STY-04, STY-07) #73 with the rest of the module's layout.Get-Credentialis handed a credential and the ones that prompt; every way an expression builds a credential and some that do not; a variable built two ways, through a typed parameter and a scope prefix, and one with an assignment that could be anything; the return edits; where an exit falls relative to a return; and in-box names, paths and patterns. The rules' own tests are unchanged and pass.Verification
./Tests/Invoke-Tests.ps1 -CodeCoverageon PowerShell 7.6.10: 1,317 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,281 passed, 43 skipped, the same 3 failed../Build/Build-RuleReference.ps1:docs/Rules.mdunchanged.Get-Helpfinds the help of each of the six functions.quality-gates.yml, started by hand on this branch because the pull request is not based onmain: run 45506618727 passed all five jobs.Notes
ConvertFrom-IslFilterRule,Invoke-IntuneWin32AppTest,Get-IntuneScriptHealth,Test-IntuneDeployedScriptandCompare-IntuneDeployedScript, and the split of the files that hold several functions.