fix(cbh): add CBH coverage tests and resolve all 26 failures#66
Merged
Conversation
- adds Tests/Locksmith2.CBHCoverage.Tests.ps1 with 6 Pester describes - covers .SYNOPSIS, .DESCRIPTION, .PARAMETER coverage, phantom parameters, .EXAMPLE presence, and .OUTPUTS/.OutputType alignment - uses PS AST parser + GetHelpContent() for accuracy; handles UTF-16LE BOM - tags Unit + CBH; integrates with existing pester config filter - 511 tests generated at discovery time; 26 genuine failures found on first run
- add CBH to Show-Logo.ps1 helpers (ConvertTo-ConsoleColor, Get-TrueColorFg, Get-TrueColorBg) - fix phantom .PARAMETER docs in Convert-IdentityReferenceToSid, Resolve-Principal, Set-DangerousEnrollee, Set-LowPrivilegeEnrollee, Get-LS2Stores - add missing .PARAMETER Forest/Credential/ExpandGroups/Rescan to Find-LS2Vulnerable* (CA, Object, Template) - add missing .PARAMETER Forest/Credential to Get-RootDSE; rename InputObject->AdcsObject in Set-CADisableExtensionList - add .EXAMPLE to Get-WebEnrollmentEndpointStatus and Initialize-LS2Scan
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
Adds a comprehensive automated Pester test suite that validates comment-based help (CBH) completeness for every function in
Private/andPublic/, then fixes all 26 failures it discovered.Changes
New Tests (
Tests/Locksmith2.CBHCoverage.Tests.ps1)511 tests across 6 Describe blocks:
.SYNOPSIS.DESCRIPTIONparam()variable must have a.PARAMETERdoc.PARAMETERdoc for non-existent params.EXAMPLErequired[OutputType]is declared,.OUTPUTSmust be presentCBH Fixes
Private/UI/Show-Logo.ps1— added full CBH toConvertTo-ConsoleColor,Get-TrueColorFg,Get-TrueColorBg(all three had zero CBH)Private/Convert/Convert-IdentityReferenceToSid.ps1— replaced phantom.PARAMETER Principal/Credential/RootDSEwith correct.PARAMETER IdentityReferencePrivate/Convert/Resolve-Principal.ps1— removed phantom.PARAMETER Credentialand.PARAMETER RootDSEPrivate/Set/Set-DangerousEnrollee.ps1— removed phantom.PARAMETER Credentialand.PARAMETER RootDSEPrivate/Set/Set-LowPrivilegeEnrollee.ps1— removed phantom.PARAMETER Credentialand.PARAMETER RootDSEPrivate/Set/Set-CADisableExtensionList.ps1— renamed.PARAMETER InputObject→.PARAMETER AdcsObjectPublic/Get-LS2Stores.ps1— removed phantom.PARAMETER Name(function takes no parameters)Public/Find-LS2VulnerableCA.ps1— added.PARAMETER Forest/Credential/ExpandGroups/RescanPublic/Find-LS2VulnerableObject.ps1— added.PARAMETER Forest/Credential/ExpandGroups/RescanPublic/Find-LS2VulnerableTemplate.ps1— added.PARAMETER Forest/Credential/ExpandGroups/RescanPrivate/Get/Get-RootDSE.ps1— added.PARAMETER Forestand.PARAMETER CredentialPrivate/Get/Get-WebEnrollmentEndpointStatus.ps1— added.EXAMPLEPrivate/Initialize/Initialize-LS2Scan.ps1— added.EXAMPLETest Results