Skip to content

Commit 0d70a3c

Browse files
so we exclude the not converted cheks and stop if only one Add Pester V5 Instance Level Checks #882
1 parent 3772dec commit 0d70a3c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

source/functions/Invoke-DbcCheck.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,18 @@ function Invoke-DbcCheck {
367367
$configuration = New-PesterConfiguration
368368
$configuration.Output.Verbosity = $NewShow
369369
$configuration.Filter.Tag = $check + 'FailedConnections'
370-
$configuration.Filter.ExcludeTag = $ExcludeCheck
370+
# Exclude the excluded checks and the not converted checks
371+
$notv5 = (Get-PSFConfigValue -FullName 'dbachecks.checks.notv5ready')
372+
$configuration.Filter.ExcludeTag = $ExcludeCheck + $notv5
373+
371374
if ($PassThru) {
372375
$configuration.Run.PassThru = $true
373376
}
377+
# So that if the only check passed in is not yet converted - so that we dont get red.
378+
if ($check -in $notv5) {
379+
Write-PSFMessage -Message "You are running a single check that is not yet converted to v5." -Level Warning
380+
Return
381+
}
374382
} catch {
375383
Write-PSFMessage -Message 'Something Went wrong' -Level Warning -ErrorRecord $_
376384
Return

0 commit comments

Comments
 (0)