Skip to content

Commit

Permalink
(fix) use Set-DbaAvailabilityGroup even when there is no diff to
Browse files Browse the repository at this point in the history
generate module output
  • Loading branch information
DorBreger committed Aug 30, 2024
1 parent f08d0d2 commit 9f3e71b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plugins/modules/availability_group.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,8 @@ try {
$existingAGHT = @{}
$existingAG.psobject.Properties | ForEach-Object { $existingAGHT[$_.Name] = $_.Value }
$agDiff = Compare-Object -ReferenceObject $existingAGHT -DifferenceObject $setAgSplat -Property $compareProperty
if ($null -ne $agDiff) {
$output = $existingAG | Set-DbaAvailabilityGroup @setAgSplat
$module.Result.changed = $true
}
$output = $existingAG | Set-DbaAvailabilityGroup @setAgSplat
$module.Result.changed = $true
}
}
elseif ($state -eq "absent") {
Expand Down

0 comments on commit 9f3e71b

Please sign in to comment.