File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -374,11 +374,19 @@ function Invoke-DbcCheck {
374
374
if ($PassThru ) {
375
375
$configuration.Run.PassThru = $true
376
376
}
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
377
+ # So that if all of the checks passed in are not yet converted so that we stop
378
+
379
+ # Compare the two arrays
380
+ $comparisonResult = Compare-Object - ReferenceObject $check - DifferenceObject $notv5
381
+
382
+ # If all elements of $check are in $notv5, then $comparisonResult will be either $null or only contain differences where SideIndicator is '=>'
383
+
384
+ if (($comparisonResult | Where-Object SideIndicator -EQ ' <=' ).Count -eq 0 ) {
385
+ $Message = " The checks that you are running {0} are yet to be converted to v5 unfortunately. We cannot continue. Please use the legacy switch"
386
+ Write-PSFMessage - Message $Message - Level Warning
380
387
Return
381
388
}
389
+
382
390
foreach ($c in $Check ) {
383
391
# So that if the only check passed in is not yet converted
384
392
if ($c -in $notv5 ) {
You can’t perform that action at this time.
0 commit comments