You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install-DbaMaintenanceSolution: change Compress/Verify/CheckSum to ValidateSet string params
Fixes#10183. The -Compress, -Verify and -CheckSum parameters were switches,
which caused documentation/behaviour mismatches:
- Switch default ($false) would set @compress = 'N' even when not specified
- Switch default ($false) would override Ola's @verify = 'Y' default
Changed all three to [string] with [ValidateSet('Default', 'ForceOn', 'ForceOff', 'Remove')]:
- Default: leaves job text unchanged (Ola's defaults: Verify='Y', Checksum='Y', no Compress)
- ForceOn: explicitly sets parameter to 'Y'
- ForceOff: explicitly sets parameter to 'N'
- Remove: strips the parameter from job text entirely
Updated NUL+Verify validation to check for ForceOff/Remove instead of boolean false.
Updated all integration tests to use the new string values.
(do *MaintenanceSolution*)
Co-authored-by: Andreas Jordan <andreasjordan@users.noreply.github.com>
@@ -312,8 +324,8 @@ function Install-DbaMaintenanceSolution {
312
324
return
313
325
}
314
326
315
-
if ($BackupLocation-eq"NUL"-and$Verify) {
316
-
Stop-Function-Message "Verify is not supported when backing up to NUL. Either backup to a different directory or turn off Verify."
327
+
if ($BackupLocation-eq"NUL"-and$Verify-notin"ForceOff","Remove") {
328
+
Stop-Function-Message "Verify is not supported when backing up to NUL. Either backup to a different directory or set -Verify to 'ForceOff' or 'Remove'."
317
329
return
318
330
}
319
331
@@ -767,17 +779,21 @@ function Install-DbaMaintenanceSolution {
767
779
}
768
780
}
769
781
770
-
# Add Compress parameter for all backup jobs
771
-
if ($Compress) {
782
+
# Compress parameter for all backup jobs
783
+
# Default: do not include @Compress (instance-level setting applies)
0 commit comments