From 5f98ccbfd5088a514a88dee78dd21a3104829e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=B6tz=20Jensen?= Date: Wed, 14 Nov 2018 08:17:03 +0100 Subject: [PATCH 1/3] Attempt to fix #4388 The $Table variable is an array and we need to loop through it. --- functions/Copy-DbaDbTableData.ps1 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/functions/Copy-DbaDbTableData.ps1 b/functions/Copy-DbaDbTableData.ps1 index 2e5d9b1259..8284c3b1b5 100644 --- a/functions/Copy-DbaDbTableData.ps1 +++ b/functions/Copy-DbaDbTableData.ps1 @@ -242,13 +242,16 @@ function Copy-DbaDbTableData { } try { - $dbTable = Get-DbaDbTable -SqlInstance $server -Table $Table -Database $Database -EnableException -Verbose:$false - if ($dbTable.Count -eq 1) { - $InputObject += $dbTable - } else { - Write-Message -Level Warning -Message "The table $Table matches $($dbTable.Count) objects. Unable to determine which object to copy" - continue + foreach ($tbl in $Table) { + $dbTable = Get-DbaDbTable -SqlInstance $server -Table $tbl -Database $Database -EnableException -Verbose:$false + if ($dbTable.Count -eq 1) { + $InputObject += $dbTable + } else { + Write-Message -Level Warning -Message "The table $tbl matches $($dbTable.Count) objects. Unable to determine which object to copy" + continue + } } + } catch { Stop-Function -Message "Unable to determine source table : $Table" return From dfc1dbb8a94e99e9880c5a8a55758a9243ab66e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=B6tz=20Jensen?= Date: Sat, 2 Mar 2019 15:38:52 +0100 Subject: [PATCH 2/3] Update Invoke-DbaAdvancedUpdate.ps1 --- functions/Invoke-DbaAdvancedUpdate.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/Invoke-DbaAdvancedUpdate.ps1 b/functions/Invoke-DbaAdvancedUpdate.ps1 index 72aae9d6f6..7727bf6746 100644 --- a/functions/Invoke-DbaAdvancedUpdate.ps1 +++ b/functions/Invoke-DbaAdvancedUpdate.ps1 @@ -41,7 +41,7 @@ Function Invoke-DbaAdvancedUpdate { Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch. .EXAMPLE - PS C:\> Invoke-DbaAdvancedUpdate -ComputerName SQL1 -Action $actions -RestartNeeded $true + PS C:\> Invoke-DbaAdvancedUpdate -ComputerName SQL1 -Action $actions Invokes update actions on SQL1 after restarting it. #> From 6b85ff560af65e88c23f7064705e3695d1bbde7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=B6tz=20Jensen?= Date: Sat, 2 Mar 2019 16:19:18 +0100 Subject: [PATCH 3/3] revert file --- functions/Copy-DbaDbTableData.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/functions/Copy-DbaDbTableData.ps1 b/functions/Copy-DbaDbTableData.ps1 index 17f6d11eea..d8c1ae3c59 100644 --- a/functions/Copy-DbaDbTableData.ps1 +++ b/functions/Copy-DbaDbTableData.ps1 @@ -262,7 +262,6 @@ function Copy-DbaDbTableData { Stop-Function -Message "The table $tbl matches $($dbTable.Count) objects. Unable to determine which object to copy" -Continue } } - } catch { Stop-Function -Message "Unable to determine source table : $Table" return