Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tests/Test-DbaLinkedServerConnection.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ Describe $CommandName -Tag IntegrationTests {
# We want to run all commands in the BeforeAll block with EnableException to ensure that the test fails if the setup fails.
$PSDefaultParameterValues["*-Dba*:EnableException"] = $true

$target = $TestConfig.InstanceSingle
$source = $TestConfig.InstanceMulti1
$target = $TestConfig.InstanceMulti2

$server = Connect-DbaInstance -SqlInstance $TestConfig.InstanceSingle
$server = Connect-DbaInstance -SqlInstance $source
if ($server.VersionMajor -ge 17) {
# 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.
# Use @datasrc with tcp: prefix to force TCP/IP and avoid Named Pipes dependency.
Expand Down Expand Up @@ -55,7 +56,7 @@ Describe $CommandName -Tag IntegrationTests {

Context "Function works" {
BeforeAll {
$results = Test-DbaLinkedServerConnection -SqlInstance $TestConfig.InstanceSingle | Where-Object LinkedServerName -eq $target
$results = Test-DbaLinkedServerConnection -SqlInstance $source | Where-Object LinkedServerName -eq $target
}

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

Context "Piping to function works" {
BeforeAll {
$pipeResults = Get-DbaLinkedServer -SqlInstance $TestConfig.InstanceSingle | Test-DbaLinkedServerConnection
$pipeResults = Get-DbaLinkedServer -SqlInstance $source | Test-DbaLinkedServerConnection
}

It "piping from Get-DbaLinkedServerConnection returns results" {
Expand Down
Loading