Skip to content

Get-DbaAgDatabase: Fix example #9683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 11, 2025
Merged

Conversation

andreasjordan
Copy link
Contributor

Type of Change

  • Bug fix (non-breaking change, fixes # )
  • New feature (non-breaking change, adds functionality, fixes # )
  • Breaking change (affects multiple commands or functionality, fixes # )
  • Ran manual Pester test and has passed (Invoke-ManualPester)
  • Adding code coverage to existing functionality
  • Pester test is included
  • If new file reference added for test, has is been added to github.com/dataplat/appveyor-lab ?
  • Unit test is included
  • Documentation
  • Build system

This wrong example was mentioned by Giles Pollock on Slack.

@@ -56,7 +56,7 @@ function Get-DbaAgDatabase {
Returns all the databases in the availability group AG101 on sql2017a

.EXAMPLE
PS C:\> Get-DbaAvailabilityGroup -SqlInstance sqlcluster -AvailabilityGroup SharePoint -Database Sharepoint_Config | Get-DbaAgDatabase
PS C:\> Get-DbaAgDatabase -SqlInstance sqlcluster -AvailabilityGroup SharePoint -Database Sharepoint_Config
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andreasjordan - does getting the availability group and piping it to Get-DbaAgDatabase not work too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just had a look at the code. Yes, this sould work as well:

Get-DbaAvailabilityGroup -SqlInstance sqlcluster -AvailabilityGroup SharePoint | Get-DbaAgDatabase -Database Sharepoint_Config

So I can change the example.

@andreasjordan andreasjordan requested a review from jpomfret June 10, 2025 17:40
Copy link
Collaborator

@jpomfret jpomfret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@jpomfret jpomfret merged commit 93c5fef into development Jun 11, 2025
13 checks passed
@jpomfret jpomfret deleted the fix_docs_GetDbaAgDatabase branch June 11, 2025 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants