Skip to content

Commit 48b2a39

Browse files
committed
Fix Resolve-Path usage to return ProviderPath in Compare-DbaDbSchema function and tests
1 parent b32aa4d commit 48b2a39

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

public/Compare-DbaDbSchema.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ function Compare-DbaDbSchema {
144144
return
145145
}
146146

147-
$sourcePathFull = (Resolve-Path -Path $SourcePath).Path
147+
$sourcePathFull = (Resolve-Path -Path $SourcePath).ProviderPath
148148
$timeStamp = (Get-Date).ToString("yyMMdd_HHmmss_f")
149149
$reportFile = Join-Path -Path $OutputPath -ChildPath "Compare-DbaDbSchema_$timeStamp.xml"
150150

@@ -167,7 +167,7 @@ function Compare-DbaDbSchema {
167167
$sqlPackageArgs += " /tcs:""$connStringEscaped"""
168168
$targetDescription = "$($targetServer.DomainInstanceName)\$TargetDatabase"
169169
} else {
170-
$targetPathFull = (Resolve-Path -Path $TargetPath).Path
170+
$targetPathFull = (Resolve-Path -Path $TargetPath).ProviderPath
171171
$targetDbName = [System.IO.Path]::GetFileNameWithoutExtension($TargetPath)
172172
$sqlPackageArgs += " /tf:""$targetPathFull"" /tdn:""$targetDbName"""
173173
$targetDescription = $TargetPath

tests/Compare-DbaDbSchema.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Describe $CommandName -Tag UnitTests {
9191
Mock Resolve-Path {
9292
param($Path)
9393
[PSCustomObject]@{
94-
Path = $Path
94+
ProviderPath = $Path
9595
}
9696
}
9797
Mock Get-Content {
@@ -157,7 +157,7 @@ Describe $CommandName -Tag UnitTests {
157157
Mock Resolve-Path {
158158
param($Path)
159159
[PSCustomObject]@{
160-
Path = $Path
160+
ProviderPath = $Path
161161
}
162162
}
163163
Mock Connect-DbaInstance {
@@ -307,7 +307,7 @@ Describe $CommandName -Tag IntegrationTests {
307307
}
308308
$result = Compare-DbaDbSchema @splatCompare
309309
$result | Should -Not -BeNullOrEmpty
310-
$result[0].SourcePath | Should -Be (Resolve-Path -Path $sourceDacpac).Path
310+
$result[0].SourcePath | Should -Be (Resolve-Path -Path $sourceDacpac).ProviderPath
311311
$result[0].Target | Should -Be $emptyTargetDacpac
312312
}
313313

0 commit comments

Comments
 (0)