Describe the bug
When attempting to set the state to absent for an availability database, it will register a change but doesn't actually drop the database. Non-readable secondary registers no change, but this is expected because OnlyAccessible is hardcoded to $true right now.
To Reproduce
Create DB
Add to AG
Drop DB
Expected behavior
Expected database to be dropped or failure because of AG dependency.
Versions(please complete the following information):
Describe the bug When attempting to set the state to
absent
for an availability database, it will register a change but doesn't actually drop the database. Non-readable secondary registers no change, but this is expected because OnlyAccessible is hardcoded to $true right now.To Reproduce Create DB Add to AG Drop DB
Expected behavior Expected database to be dropped or failure because of AG dependency.
Versions(please complete the following information):
Additional context I believe we need a try/catch here. https://github.com/lowlydba/lowlydba.sqlserver/blob/main/plugins/modules/database.ps1#L66