Skip to content

How do i Use the New-PesterConfiguration ? I can't get it to set Verbosity to Diagnostic in my output #2328

Answered by fflaten
esdccs1 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for reporting this!

Right above the first sample it says "while running interactively". Interactive execution means running the script directly without calling Invoke-Pester, typically by pressing F5 in VSCode or ISE. So it's intended behavior, but poorly explained and something we should update 🙂

$PesterPreference is session preferences (like $PSDefaultParameterValues in PowerShell) and any values has to be set before calling Invoke-Pester which merges it with any provided parameters. In general I'd recommend to avoid $PesterPreference unless you want to include a few settings in your profile

Instead you could use a test.ps1 file where you define your configuration and pass it to I…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@esdccs1
Comment options

Answer selected by esdccs1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants