Skip to content

Get-DbaRegServer - Fix IncludeSelf to return pipeline-compatible object#10238

Merged
potatoqualitee merged 1 commit into
developmentfrom
claude/issue-8382-20260314-1417
Mar 16, 2026
Merged

Get-DbaRegServer - Fix IncludeSelf to return pipeline-compatible object#10238
potatoqualitee merged 1 commit into
developmentfrom
claude/issue-8382-20260314-1417

Conversation

@andreasjordan
Copy link
Copy Markdown
Collaborator

Fix -IncludeSelf in Get-DbaRegServer so the CMS instance itself is returned as a fully-populated object that can be piped to downstream commands like Get-DbaDefaultPath.

The previous implementation used Select-Object which stripped the ToString ScriptMethod and SqlInstance/ComputerName/InstanceName properties, causing piped commands to silently skip the CMS server.

Closes #8382

Generated with Claude Code

When using -IncludeSelf, the CMS instance is now returned as a proper
object with SqlInstance, ComputerName, InstanceName, and a ToString()
ScriptMethod, allowing it to be piped to commands like Get-DbaDefaultPath.

Previously, Select-Object stripped the ToString ScriptMethod and the
extra properties needed for piping, causing downstream commands to fail
for the CMS instance itself.

Fixes #8382

(do Get-DbaRegServer)

Co-authored-by: Andreas Jordan <andreasjordan@users.noreply.github.com>
@potatoqualitee potatoqualitee merged commit 8099963 into development Mar 16, 2026
15 checks passed
@potatoqualitee potatoqualitee deleted the claude/issue-8382-20260314-1417 branch March 16, 2026 05:08
potatoqualitee added a commit that referenced this pull request Apr 10, 2026
…(review of #10238)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Get-DbaRegServer IncludeSelf

2 participants