Skip to content

Commit 0ffddd2

Browse files
authored
New-DbaDbMaskingConfig, account for lots of tables (#9642)
1 parent a5588b1 commit 0ffddd2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

public/New-DbaDbMaskingConfig.ps1

+5-1
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,11 @@ function New-DbaDbMaskingConfig {
609609
$filenamepart = $server.Name.Replace('\', '$').Replace('TCP:', '').Replace(',', '.')
610610

611611
if ($Table) {
612-
$temppath = Join-Path -Path $Path -ChildPath "$($filenamepart).$($db.Name).$($Table -join '-').DataMaskingConfig.json"
612+
if ($Table.Count -ge 5) {
613+
$temppath = Join-Path -Path $Path -ChildPath "$($filenamepart).$($db.Name).Tables_$(Get-Date -f 'yyyyMMddHHmmss').DataMaskingConfig.json"
614+
} else {
615+
$temppath = Join-Path -Path $Path -ChildPath "$($filenamepart).$($db.Name).$($Table -join '-').DataMaskingConfig.json"
616+
}
613617
} else {
614618
$temppath = Join-Path -Path $Path -ChildPath "$($filenamepart).$($db.Name).DataMaskingConfig.json"
615619
}

0 commit comments

Comments
 (0)