[x] Hopefully helps fixing #9253 together with other changes
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
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
See #9253 for more details.