Skip to content

Added AppendServerInstance to Invoke-DbaWhoIsActive. #9672

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

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

ReeceGoding
Copy link
Contributor

Type of Change

  • Bug fix (non-breaking change, fixes # )
  • New feature (non-breaking change, adds functionality, fixes Add -AppendServerInstance to Invoke-DbaWhoIsActive #9540 )
  • 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

Purpose

When you call Invoke-DbaWhoIsActive on a bunch of servers at once, it pays to know which server you're seeing.

Approach

The key was to realise that the bulk of the code in Invoke-DbaWhoIsActive is for SQL parameters, not PowerShell ones.

Commands to test

I used Invoke-DbaWhoIsActive -SqlInstance $ins -ShowSystemSpids -AppendServerInstance. The glaring omission in my testing is that I only have one instance running locally. I'm already pushing my ancient laptop too hard to risk spinning up another.

Screenshots

image

Learning

-AppendServerInstance:$AppendServerInstance is a good trick that I didn't know previously. In fact, it concerns me. Is the EnableException parameter in Invoke-DbaWhoIsActive dead code?

@niphlod
Copy link
Contributor

niphlod commented May 19, 2025

Hi @ReeceGoding , when closing #9540 what I meant is "given it's doable in 4 lines let's not add yet another piece of code".
Changing code means also adding regression tests to make sure nothing breaks down the line and, frankly, the manpower required to support each and every small iteration of "new params" just adds weight without providing "meaningful" value.
I said this lots of times during the years here and in Slack: "dbatools is not dbasolutions".

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.

Add -AppendServerInstance to Invoke-DbaWhoIsActive
2 participants