Skip to content

Pass pester_verbosity through to Invoke-Maester so the input takes effect - #49

Open
kongkratos wants to merge 1 commit into
maester365:mainfrom
kongkratos:fix/pester-verbosity
Open

Pass pester_verbosity through to Invoke-Maester so the input takes effect#49
kongkratos wants to merge 1 commit into
maester365:mainfrom
kongkratos:fix/pester-verbosity

Conversation

@kongkratos

@kongkratos kongkratos commented Aug 12, 2026

Copy link
Copy Markdown

Fixes #48

The pester_verbosity input is currently a no-op. Setting it to Detailed produces no Pester output at all, while still logging Pester verbosity level set to: Detailed, so it looks like it was applied.

Cause

The script configures a PesterConfiguration object and passes it to Invoke-Maester, but never passes -Verbosity:

$PesterConfiguration = New-PesterConfiguration
$PesterConfiguration.Output.Verbosity = $PesterVerbosity

$MaesterParameters = @{
    Path                 = $Path
    PesterConfiguration  = $PesterConfiguration
    ...
}

Invoke-Maester -> GetPesterConfiguration (Maester 2.2.0) then overwrites the value unconditionally:

$PesterConfiguration.Run.PassThru = $true
$PesterConfiguration.Output.Verbosity = $Verbosity   # defaults to 'None'

Since the action never binds -Verbosity, the configured level is replaced with None on every run.

Change

Adds Verbosity = $PesterVerbosity to the parameter hashtable so the value survives.

Verification

Reproduced the interaction against real Pester 5.7.1 types, mirroring GetPesterConfiguration:

Action sets config to  : Detailed
Current behavior       : None
With -Verbosity passed : Detailed

Notes

  • -Verbosity is an existing Invoke-Maester parameter with the same validated set (None, Normal, Detailed, Diagnostic) as the action input, so it passes the script's existing version-compatibility guard that strips unsupported parameters.
  • The input already defaults to None, which is also Invoke-Maester's default, so runs that do not set pester_verbosity are unaffected.
  • This matters most for large tenants where a run takes an hour or more. Today the log is silent between Start test execution and completion, so there is no way to tell a slow run from a hung one.

As noted in #48, it may also be worth changing Maester itself so GetPesterConfiguration only overrides Output.Verbosity when the caller explicitly bound -Verbosity, so an explicitly supplied -PesterConfiguration is not silently overwritten. That is a separate change in the module repo and is not needed for this fix.

Summary by CodeRabbit

  • Improvements
    • Pester verbosity settings are now passed through when running Maester actions, providing more consistent and configurable test output.

The pester_verbosity input was a no-op. The script set Output.Verbosity on a
PesterConfiguration object but never passed -Verbosity, so Invoke-Maester's
GetPesterConfiguration overwrote it with its own default of 'None'.

Fixes maester365#48
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6f31e542-2742-428c-9c09-f562c45bec31

📥 Commits

Reviewing files that changed from the base of the PR and between 11358d6 and 220905d.

📒 Files selected for processing (1)
  • script/Run-MaesterAction.ps1

📝 Walkthrough

Walkthrough

The action now passes the configured PesterVerbosity value to Invoke-Maester.

Changes

Pester verbosity

Layer / File(s) Summary
Forward configured verbosity
script/Run-MaesterAction.ps1
Adds PesterVerbosity to the parameters passed to Invoke-Maester.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: svrooij

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: passing Pester verbosity to Invoke-Maester.
Description check ✅ Passed The description explains the issue, cause, code change, verification, compatibility, and linked issue context in sufficient detail.
Linked Issues check ✅ Passed The one-line change directly implements issue #48 by passing Verbosity to Invoke-Maester and preserves the configured Pester verbosity.
Out of Scope Changes check ✅ Passed The only reported code change supports the linked issue and introduces no unrelated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pester_verbosity input has no effect: Invoke-Maester resets Output.Verbosity to None

1 participant