Skip to content
Permalink
Browse files

Copy-DbaDatabase, pssa fixes (#5730)

  • Loading branch information...
niphlod authored and potatoqualitee committed Jun 12, 2019
1 parent d111535 commit 1b7819233c2af53a5bf749275f7ed26d6017215d
Showing with 2 additions and 1 deletion.
  1. +2 −1 functions/Copy-DbaDatabase.ps1
@@ -182,6 +182,7 @@ function Copy-DbaDatabase {
#>
[CmdletBinding(DefaultParameterSetName = "DbBackup", SupportsShouldProcess, ConfirmImpact = "Medium")]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseOutputTypeCorrectly", "", Justification = "PSSA Rule Ignored by BOH")]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingPlainTextForPassword", "AzureCredential", Justification = "Unfortunate variable name that doesn't hold a password")]
param (
[DbaInstanceParameter]$Source,
[PSCredential]$SourceSqlCredential,
@@ -1286,7 +1287,7 @@ function Copy-DbaDatabase {
$dbOwner = Get-SaLoginName -SqlInstance $destServer
}
try {
$ownerResult = $destServer.Query("ALTER DATABASE [$dbname] SET READ_WRITE")
$null = $destServer.Query("ALTER DATABASE [$dbname] SET READ_WRITE")
} catch {
Stop-Function -Message "Failure setting $dbname to read-write on destination server" -ErrorRecord $_
}

0 comments on commit 1b78192

Please sign in to comment.
You can’t perform that action at this time.