Add-DbaAgListener - Stop demanding databases the command does not know - #10612
Open
andreasjordan wants to merge 1 commit into
Open
Add-DbaAgListener - Stop demanding databases the command does not know#10612andreasjordan wants to merge 1 commit into
andreasjordan wants to merge 1 commit into
Conversation
The error text for a missing -AvailabilityGroup told the user to specify "one or more databases and one or more Availability Groups", but the command has no Database parameter at all. The wording was copy-pasted from the availability group database commands. (do Add-DbaAgListener)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
Add-DbaAgListeneris called with-SqlInstancebut without-AvailabilityGroup, it stops with:The command has no
-Databaseparameter at all — the wording was copy-pasted from the availability group database commands. A user who follows the message literally is told to supply a parameter that does not exist.What changed
The message now matches what the check at that line actually requires:
One line; no behavior change. No test asserts the old wording, so no test changes are needed. The existing test file passes against the lab HADR instance (3/3).
Sibling wording fixes for
Remove-DbaAgDatabaseandRemove-DbaAgListenerride along in #10608 and #10609;Set-DbaAgListenerhas the same message shape but its text matches its check, so it is untouched.🤖 Generated with Claude Code