Skip to content

Commit

Permalink
so we exclude the not converted cheks and stop if only one Add Pester…
Browse files Browse the repository at this point in the history
… V5 Instance Level Checks #882
  • Loading branch information
SQLDBAWithABeard committed Aug 26, 2023
1 parent 3772dec commit 0d70a3c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion source/functions/Invoke-DbcCheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d70a3c

Please sign in to comment.