Skip to content

Commit

Permalink
Get-DbaServerRoleMember - Correcting call to child call for Get-DbaLo…
Browse files Browse the repository at this point in the history
…gin (#5132)

* format and correcting connect issue to login cmd

* remove restart of agent (test don't require runing state)
  • Loading branch information
wsmelton authored and potatoqualitee committed Mar 4, 2019
1 parent dac7c62 commit d6077d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 6 additions & 3 deletions functions/Get-DbaServerRoleMember.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function Get-DbaServerRoleMember {
param (
[parameter(Position = 0, Mandatory, ValueFromPipeline)]
[Alias('ServerInstance', 'SqlServer')]
[DbaInstance[]]$SqlInstance,
[DbaInstanceParameter[]]$SqlInstance,
[Alias('Credential')]
[PSCredential]$SqlCredential,
[string[]]$ServerRole,
Expand All @@ -105,9 +105,12 @@ function Get-DbaServerRoleMember {
$roles = $server.Roles

if (Test-Bound -ParameterName 'Login') {
$logins = Get-DbaLogin -SqlInstance $instance -Login $Login
try {
$logins = Get-DbaLogin -SqlInstance $server -Login $Login -EnableException
} catch {
Stop-Function -Message "Issue gathering login details" -ErrorRecord $_ -Target $instance
}
Write-Message -Level 'Verbose' -Message "Filtering by logins: $($logins -join ', ')"

foreach ($l in $logins) {
$loginRoles += $l.ListMembers()
}
Expand Down
1 change: 0 additions & 1 deletion tests/appveyor.SQL2017.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Write-Host -Object "$indent Starting $instance" -ForegroundColor DarkGreen
#Restart-Service "SQLAgent`$$instance" -WarningAction SilentlyContinue -Force

$null = Enable-DbaAgHadr -SqlInstance $sqlinstance -Confirm:$false -Force
Restart-Service "SQLAgent`$$instance" -WarningAction SilentlyContinue -Force

do {
Start-Sleep 1
Expand Down

0 comments on commit d6077d3

Please sign in to comment.