{"action":"opened","issue":{"url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/3616","repository_url":"https://api.github.com/repos/sqlcollaborative/dbatools","labels_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/3616/labels{/name}","comments_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/3616/comments","events_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/3616/events","html_url":"https://github.com/sqlcollaborative/dbatools/issues/3616","id":323974396,"number":3616,"title":"Connect-SqlInstance and DbaInstanceParameter and re-use server connection object","user":{"login":"Zhunya","id":14327077,"avatar_url":"https://avatars1.githubusercontent.com/u/14327077?v=4","gravatar_id":"","url":"https://api.github.com/users/Zhunya","html_url":"https://github.com/Zhunya","followers_url":"https://api.github.com/users/Zhunya/followers","following_url":"https://api.github.com/users/Zhunya/following{/other_user}","gists_url":"https://api.github.com/users/Zhunya/gists{/gist_id}","starred_url":"https://api.github.com/users/Zhunya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zhunya/subscriptions","organizations_url":"https://api.github.com/users/Zhunya/orgs","repos_url":"https://api.github.com/users/Zhunya/repos","events_url":"https://api.github.com/users/Zhunya/events{/privacy}","received_events_url":"https://api.github.com/users/Zhunya/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-17T11:02:21Z","updated_at":"2018-05-17T11:02:21Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"## Steps to Reproduce\r\n\r\nFor example\r\n\r\n```powershell\r\n\r\nRestore-DbaDatabase -SqlInstance <[string]SqlServerName> -SqlCredentials <[object]credentialt>...\r\n\r\n```\r\n\r\n## Expected Behavior\r\n\r\nFunction will build connection object, and reuses it thru all other internal call to other funtions.\r\n\r\n## Actual Behavior\r\n\r\nConnection object lost credential somewhere between lines [390](https://github.com/sqlcollaborative/dbatools/blob/development/functions/Restore-DbaDatabase.ps1#L390) and [541](https://github.com/sqlcollaborative/dbatools/blob/development/functions/Restore-DbaDatabase.ps1#L541)\r\n\r\n\r\n"}}
{"actor":{"display_login":"Zhunya"}}