Skip to content

Install-DbaMaintenanceSolution: change Compress/Verify/CheckSum to ValidateSet string params#10247

Open
andreasjordan wants to merge 1 commit intodevelopmentfrom
claude/issue-10183-20260314-2045
Open

Install-DbaMaintenanceSolution: change Compress/Verify/CheckSum to ValidateSet string params#10247
andreasjordan wants to merge 1 commit intodevelopmentfrom
claude/issue-10183-20260314-2045

Conversation

@andreasjordan
Copy link
Collaborator

Fixes #10183.

Changed -Compress, -Verify, and -CheckSum from [switch] to [string] parameters with [ValidateSet('Default', 'ForceOn', 'ForceOff', 'Remove')].

Default = leave Ola's job text unchanged (Verify='Y', Checksum='Y', no Compress)
ForceOn = explicitly set parameter to 'Y'
ForceOff = explicitly set parameter to 'N'
Remove = strip the parameter from job text entirely

Generated with Claude Code

…lidateSet 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>
@ReeceGoding
Copy link
Contributor

Looks mostly good. My objections are fairly minor. My only major objection is the lack of test coverage. Specifically, only ForceOn and ForceOff explicitly appear in the tests.

I would also like to import whatever we can from #10184, but converting that to use the new strings will be tedious.

@andreasjordan
Copy link
Collaborator Author

Ok, I will try and see if Claude can help here tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Install-DbaMaintenanceSolution: defaults reported by documentation are incorrect

2 participants