Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Commit b09c74a

Browse files
committed
Use proper Pester 4.0 parameter for showing test output
1 parent 72429b4 commit b09c74a

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

Modules/OperationValidation/OperationValidation.psm1

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,6 @@ function Invoke-OperationValidation
453453
)
454454
BEGIN
455455
{
456-
$quiet = ! $IncludePesterOutput
457456
if ( ! (get-module -Name Pester))
458457
{
459458
if ( get-module -list Pester )
@@ -505,11 +504,28 @@ function Invoke-OperationValidation
505504
{
506505
$pesterParams = @{
507506
TestName = $ti.Name
508-
Quiet = $quiet
509507
PassThru = $true
510508
Verbose = $false
511509
}
512510

511+
# Pester 4.0.0 deprecated the 'Quiet' parameter in favor of 'Show'
512+
$pesterMod = Get-Module -Name Pester
513+
if ($pesterMod.Version -ge '4.0.0')
514+
{
515+
if ($IncludePesterOutput)
516+
{
517+
$pesterParams.Show = 'All'
518+
}
519+
else
520+
{
521+
$pesterParams.Show = 'None'
522+
}
523+
}
524+
else
525+
{
526+
$pesterParams.Quiet = !$IncludePesterOutput
527+
}
528+
513529
if ($ti.ScriptParameters)
514530
{
515531
Write-Verbose -Message 'Test has script parameters'

0 commit comments

Comments
 (0)