dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.39k stars 787 forks source link

Connect-DbaInstance - Connect DAC to test connection as soon as possible #9305

Closed andreasjordan closed 2 months ago

andreasjordan commented 3 months ago

Type of Change

Purpose

All other commands rely on Connect-DbaInstance returning an open connection. So this has to be true for DAC as well. So we have to open the DAC inside of Connect-DbaInstance.

Commands to test

# This should fail on the second line:
$dac1 = Connect-DbaInstance -SqlInstance SQL01 -DedicatedAdminConnection
$dac2 = Connect-DbaInstance -SqlInstance SQL01 -DedicatedAdminConnection

See #9253 for more details.

potatoqualitee commented 2 months ago

hoepful 🤞🏼