Skip to content

Commit

Permalink
Invoke-DbatoolsFormatter
Browse files Browse the repository at this point in the history
  • Loading branch information
avm committed Feb 4, 2019
1 parent ec1a234 commit 535405a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions functions/Get-DbaDbRoleMember.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,13 @@ function Get-DbaDbRoleMember {
Stop-Function -Message 'Failure' -Category ConnectionError -ErrorRecord $_ -Target $instance -Continue
}

foreach($item in $Database) {
foreach ($item in $Database) {
Write-Message -Level Verbose -Message "Check if database: $item on $instance is accessible or not"
try {
if($server.Databases[$item].IsAccessible -eq $false) {
if ($server.Databases[$item].IsAccessible -eq $false) {
throw "Database: $item is not accessible. Check your permissions or database state."
}
}
catch {
} catch {
Stop-Function -Message 'Failure' -Category ResourceUnavailable -ErrorRecord $_ -Target $instance -Continue
}
}
Expand Down

0 comments on commit 535405a

Please sign in to comment.