Skip to content
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

Get-DbaCmsRegServer when using -IncludeSelf and assigning result to variable #5367

Closed
2 of 3 tasks
ybeauchamps opened this issue Apr 12, 2019 · 1 comment · Fixed by #5480
Closed
2 of 3 tasks

Get-DbaCmsRegServer when using -IncludeSelf and assigning result to variable #5367

ybeauchamps opened this issue Apr 12, 2019 · 1 comment · Fixed by #5480

Comments

@ybeauchamps
Copy link

  • Running latest release of dbatools
  • Verified errors are not related to permissions
  • Is this bug with Copy-DbaDatabase? You can replicate it using Backup-DbaDatabase ... | Restore-DbaDatabase ...

NOTE: Copy-DbaDatabase will not work in every environment and every situation. Instead, we try to ensure Backup & Restore work in your environment.

Environmental data

Name Value


PSVersion 5.1.14409.1005
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1005
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

dbatools Module version:

Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.803\dbatools.psd1
Version : 0.9.803

SQL Server:

Microsoft SQL Server 2016 (SP2-GDR) (KB4293802) - 13.0.5081.1 (X64) Jul 20 2018 22:12:40 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows Server 2016 Standard 10.0 (Build 14393: ) (Hypervisor)

Errors Received

NONE

Steps to Reproduce

$CMS = "CMSServer"
$Servers = Get-DbaCmsRegServer -SqlInstance $CMS -IncludeSelf
$Servers

VS

$CMS = "CMSServer"
Get-DbaCmsRegServer -SqlInstance $CMS -IncludeSelf

Expected Behavior

The variable should contain all the servers from a CMS including the CMS server itself.

Actual Behavior

It appears to overwrite the first object in the list with itself a second time. i.e. the CMS server will be the first and last object in the list.

@potatoqualitee
Copy link
Member

Thank you for your report. We'll take a look when we get a moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants