Skip to content

Commit e73e7f8

Browse files
Fix test for Test-DbaLinkedServerConnection (#10354)
1 parent d831e81 commit e73e7f8

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

tests/Test-DbaLinkedServerConnection.Tests.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ Describe $CommandName -Tag IntegrationTests {
2525
# We want to run all commands in the BeforeAll block with EnableException to ensure that the test fails if the setup fails.
2626
$PSDefaultParameterValues["*-Dba*:EnableException"] = $true
2727

28-
$target = $TestConfig.InstanceSingle
28+
$source = $TestConfig.InstanceMulti1
29+
$target = $TestConfig.InstanceMulti2
2930

30-
$server = Connect-DbaInstance -SqlInstance $TestConfig.InstanceSingle
31+
$server = Connect-DbaInstance -SqlInstance $source
3132
if ($server.VersionMajor -ge 17) {
3233
# Starting with SQL Server 2025 (17.x), MSOLEDBSQL uses Microsoft OLE DB Driver version 19, which adds support for TDS 8.0. However, this driver introduces a breaking change. You must now specify the encrypt parameter.
3334
# Use @datasrc with tcp: prefix to force TCP/IP and avoid Named Pipes dependency.
@@ -55,7 +56,7 @@ Describe $CommandName -Tag IntegrationTests {
5556

5657
Context "Function works" {
5758
BeforeAll {
58-
$results = Test-DbaLinkedServerConnection -SqlInstance $TestConfig.InstanceSingle | Where-Object LinkedServerName -eq $target
59+
$results = Test-DbaLinkedServerConnection -SqlInstance $source | Where-Object LinkedServerName -eq $target
5960
}
6061

6162
It "function returns results" {
@@ -74,7 +75,7 @@ Describe $CommandName -Tag IntegrationTests {
7475

7576
Context "Piping to function works" {
7677
BeforeAll {
77-
$pipeResults = Get-DbaLinkedServer -SqlInstance $TestConfig.InstanceSingle | Test-DbaLinkedServerConnection
78+
$pipeResults = Get-DbaLinkedServer -SqlInstance $source | Test-DbaLinkedServerConnection
7879
}
7980

8081
It "piping from Get-DbaLinkedServerConnection returns results" {

0 commit comments

Comments
 (0)