Skip to content

Commit

Permalink
Implementing Test-DbaPath for Testing Copy Folder for Log Shipping Se…
Browse files Browse the repository at this point in the history
…condary (dataplat#8826)
  • Loading branch information
sqldeployhelmet authored Apr 1, 2023
1 parent d028d01 commit 279e8f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion private/functions/New-DbaLogShippingPrimaryDatabase.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function New-DbaLogShippingPrimaryDatabase {
Stop-Function -Message "The backup share path $BackupShare should be formatted in the form \\server\share." -Target $SqlInstance
return
} else {
if (-not ((Test-Path $BackupShare -PathType Container -IsValid) -and ((Get-Item $BackupShare).PSProvider.Name -eq 'FileSystem'))) {
if (-not ((Test-DbaPath $BackupShare -SqlInstance $SqlInstance -SqlCredential $SqlCredential) -and ((Get-Item $BackupShare).PSProvider.Name -eq 'FileSystem'))) {
Stop-Function -Message "The backup share path $BackupShare is not valid or can't be reached." -Target $SqlInstance
return
}
Expand Down
2 changes: 1 addition & 1 deletion private/functions/New-DbaLogShippingSecondaryPrimary.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function New-DbaLogShippingSecondaryPrimary {
Stop-Function -Message "The backup destination path should be formatted in the form \\server\share." -Target $SqlInstance
return
} else {
if (-not ((Test-Path $BackupDestinationDirectory -PathType Container -IsValid) -and ((Get-Item $BackupDestinationDirectory).PSProvider.Name -eq 'FileSystem'))) {
if (-not ((Test-DbaPath $BackupDestinationDirectory -SqlInstance $SqlInstance -SqlCredential $SqlCredential) -and ((Get-Item $BackupDestinationDirectory).PSProvider.Name -eq 'FileSystem'))) {
Stop-Function -Message "The backup destination path is not valid or can't be reached." -Target $SqlInstance
return
}
Expand Down

0 comments on commit 279e8f2

Please sign in to comment.