Skip to content

Commit e798ca4

Browse files
Start-DbaDbEncryption: Add missing parameter and fix documentation (#10191)
1 parent 8f70396 commit e798ca4

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

public/New-DbaDbEncryptionKey.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function New-DbaDbEncryptionKey {
161161
$null = $db.Parent.Refresh()
162162
$null = $db.Parent.Databases["master"].Refresh()
163163
}
164-
if ($dbcert.LastBackupDate.Year -eq 1 -and -not $Force) {
164+
if ($dbcert.LastBackupDate.Year -eq 1 -and -not $Force -and -not $WhatIfPreference) {
165165
Stop-Function -Message "Certificate ($EncryptorName) in master on $($db.Parent) has not been backed up. Please backup your certificate or use -Force to continue" -Continue
166166
}
167167
}

public/Start-DbaDbEncryption.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ function Start-DbaDbEncryption {
2121
For MFA support, please use Connect-DbaInstance.
2222
2323
.PARAMETER Database
24-
Specifies which user databases to encrypt with Transparent Data Encryption (TDE). Accepts single database names, arrays, or wildcards.
24+
Specifies which user databases to encrypt with Transparent Data Encryption (TDE).
2525
Use this when you need to encrypt specific databases instead of all user databases on the instance.
2626
2727
.PARAMETER ExcludeDatabase
28-
Specifies which databases to exclude from TDE encryption when using wildcards or AllUserDatabases.
28+
Specifies which databases to exclude from TDE encryption when using AllUserDatabases.
2929
Useful when you want to encrypt most databases but need to skip specific ones due to compatibility or business requirements.
3030
3131
.PARAMETER EncryptorName
@@ -168,6 +168,7 @@ function Start-DbaDbEncryption {
168168
[ValidateSet("AsymmetricKey", "Certificate")]
169169
[string]$EncryptorType = "Certificate",
170170
[string[]]$Database,
171+
[string[]]$ExcludeDatabase,
171172
[Parameter(Mandatory)]
172173
[string]$BackupPath,
173174
[Parameter(Mandatory)]

tests/Start-DbaDbEncryption.Tests.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Describe $CommandName -Tag UnitTests {
1616
"EncryptorName",
1717
"EncryptorType",
1818
"Database",
19+
"ExcludeDatabase",
1920
"BackupPath",
2021
"MasterKeySecurePassword",
2122
"CertificateSubject",

0 commit comments

Comments
 (0)