Conversation
In Windows PowerShell 5.1, the Verbose common parameter is automatically
added to $PSBoundParameters with a value of [SwitchParameter]$false even
when -Verbose is not explicitly passed. Using ContainsKey('Verbose')
therefore always returned $true, causing New-AsBuiltReport to unconditionally
pass -Verbose to the Document block and every Invoke-<Report> call.
Revert to the original $PSCmdlet.MyInvocation.BoundParameters['Verbose'].IsPresent
check, which correctly evaluates to false when the switch is absent or
bound-but-false, and only true when the user explicitly passes -Verbose.
https://claude.ai/code/session_019hdGnHpEF3UevtELrNtidw
Bump version to 1.6.4 and update CHANGELOG referencing issue #77. https://claude.ai/code/session_019hdGnHpEF3UevtELrNtidw
…ssion
Reverts $PSBoundParameters.ContainsKey('Verbose') back to
$PSCmdlet.MyInvocation.BoundParameters['Verbose'].IsPresent to fix
verbose output being always enabled on Windows PowerShell 5.1.
Closes #77
https://claude.ai/code/session_019hdGnHpEF3UevtELrNtidw
|
PSScriptAnalyzer results: Errors: [0], Warnings: [202], Information: [1]
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
X now charges for API access, making the tweet action cost-prohibitive. Update CHANGELOG for v1.6.4. https://claude.ai/code/session_019hdGnHpEF3UevtELrNtidw
|
PSScriptAnalyzer results: Errors: [0], Warnings: [202], Information: [1]
|
rebelinux
approved these changes
May 15, 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
$PSBoundParameters.ContainsKey('Verbose')back to$PSCmdlet.MyInvocation.BoundParameters['Verbose'].IsPresentinNew-AsBuiltReportto fix verbose output being unconditionally enabled on Windows PowerShell 5.11.6.4CHANGELOG.mdwith[1.6.4]entryCloses #77
Root Cause
The v1.6.3 change (commit
5e635d4, applied from a Copilot suggestion) swapped the verbose detection check:In Windows PowerShell 5.1, the
Verbosecommon parameter is automatically added to$PSBoundParameterswith a value of[SwitchParameter]$falseeven when-Verboseis not explicitly passed. This causedContainsKey('Verbose')to always return$true, makingNew-AsBuiltReportunconditionally pass-Verboseto the PScriboDocument { }block and everyInvoke-<ReportModule>call. PowerShell 7+ does not exhibit this behaviour, which is why the regression was Windows-only.Test plan
New-AsBuiltReporton Windows PowerShell 5.1 without-Verboseand confirm no verbose output is producedNew-AsBuiltReporton Windows PowerShell 5.1 with-Verboseand confirm verbose output is producedNew-AsBuiltReporton PowerShell 7+ with and without-Verboseand confirm behaviour is unchangedhttps://claude.ai/code/session_019hdGnHpEF3UevtELrNtidw
Generated by Claude Code