@@ -534,28 +534,30 @@ function New-DbaAvailabilityGroup {
534534 if (($SharedPath )) {
535535 if (-not (Test-DbaPath - SqlInstance $Primary - SqlCredential $PrimarySqlCredential - Path $SharedPath )) {
536536 Write-Progress - Activity " Adding new availability group" - Completed
537- Stop-Function - Continue - Message " Cannot access $SharedPath from $Primary "
537+ # No -Continue on these guards: no loop encloses them, so the continue escaped the
538+ # command before the return below ever ran and ate an iteration of the caller's loop.
539+ Stop-Function - Message " Cannot access $SharedPath from $Primary "
538540 return
539541 }
540542 }
541543
542544 if ($Database -and -not $UseLastBackup -and -not $SharedPath -and $Secondary -and $SeedingMode -ne ' Automatic' ) {
543545 Write-Progress - Activity " Adding new availability group" - Completed
544- Stop-Function - Continue - Message " You must specify a SharedPath when adding databases to a manually seeded availability group"
546+ Stop-Function - Message " You must specify a SharedPath when adding databases to a manually seeded availability group"
545547 return
546548 }
547549
548550 if ($server.HostPlatform -eq " Linux" ) {
549551 # New to SQL Server 2017 (14.x) is the introduction of a cluster type for AGs. For Linux, there are two valid values: External and None.
550552 if ($ClusterType -notin " External" , " None" ) {
551553 Write-Progress - Activity " Adding new availability group" - Completed
552- Stop-Function - Continue - Message " Linux only supports ClusterType of External or None"
554+ Stop-Function - Message " Linux only supports ClusterType of External or None"
553555 return
554556 }
555557 # Microsoft Distributed Transaction Coordinator (DTC) is not supported under Linux in SQL Server 2017
556558 if ($DtcSupport ) {
557559 Write-Progress - Activity " Adding new availability group" - Completed
558- Stop-Function - Continue - Message " Microsoft Distributed Transaction Coordinator (DTC) is not supported under Linux"
560+ Stop-Function - Message " Microsoft Distributed Transaction Coordinator (DTC) is not supported under Linux"
559561 return
560562 }
561563 }
0 commit comments