From 75627adb8c3418870dc82a6242efcceb9662211b Mon Sep 17 00:00:00 2001 From: sqlslinger <64641794+sqlslinger@users.noreply.github.com> Date: Mon, 12 Dec 2022 07:05:54 -0500 Subject: [PATCH] Fix Copy-DbaSysDbUserObject to include indexes (#8668) The Copy-DbaSysDbUserObject function was missing the Indexes = true option when the -Classic switch is not on. Co-authored-by: Vince Iacoboni --- functions/Copy-DbaSysDbUserObject.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/functions/Copy-DbaSysDbUserObject.ps1 b/functions/Copy-DbaSysDbUserObject.ps1 index 52184e0aab..8793f59f60 100644 --- a/functions/Copy-DbaSysDbUserObject.ps1 +++ b/functions/Copy-DbaSysDbUserObject.ps1 @@ -220,6 +220,7 @@ function Copy-DbaSysDbUserObject { $transfer = New-Object Microsoft.SqlServer.Management.Smo.Transfer $smodb $null = $transfer.CopyAllObjects = $false $null = $transfer.Options.WithDependencies = $true + $null = $transfer.Options.Indexes = $true $null = $transfer.ObjectList.Add($table) if ($PSCmdlet.ShouldProcess($destServer, "Attempting to add table $table to $systemDb")) { try {