From 0d70a3cd1b84c427816fa76e036267da98b05bb0 Mon Sep 17 00:00:00 2001 From: Rob Sewell Date: Sat, 26 Aug 2023 15:24:15 +0000 Subject: [PATCH] so we exclude the not converted cheks and stop if only one Add Pester V5 Instance Level Checks #882 --- source/functions/Invoke-DbcCheck.ps1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/functions/Invoke-DbcCheck.ps1 b/source/functions/Invoke-DbcCheck.ps1 index a79d8a52..ca1aeeb1 100644 --- a/source/functions/Invoke-DbcCheck.ps1 +++ b/source/functions/Invoke-DbcCheck.ps1 @@ -367,10 +367,18 @@ function Invoke-DbcCheck { $configuration = New-PesterConfiguration $configuration.Output.Verbosity = $NewShow $configuration.Filter.Tag = $check + 'FailedConnections' - $configuration.Filter.ExcludeTag = $ExcludeCheck + # Exclude the excluded checks and the not converted checks + $notv5 = (Get-PSFConfigValue -FullName 'dbachecks.checks.notv5ready') + $configuration.Filter.ExcludeTag = $ExcludeCheck + $notv5 + if ($PassThru) { $configuration.Run.PassThru = $true } + # So that if the only check passed in is not yet converted - so that we dont get red. + if ($check -in $notv5) { + Write-PSFMessage -Message "You are running a single check that is not yet converted to v5." -Level Warning + Return + } } catch { Write-PSFMessage -Message 'Something Went wrong' -Level Warning -ErrorRecord $_ Return