Deferred from #10621 and PR #10631, which fixed the -EnableException half of the problem and explicitly left this half "for a maintainer decision". Since #10621 closes when that PR merges, the open half gets its own issue so it is not lost.
Behavior after #10631
When the backup information pipeline selects nothing restorable — diff/log backups without a full to anchor the chain, or a path holding no backups at all:
Decision to make
Should the non-exception path also treat an empty selection as a failure rather than a warn-and-return? Options discussed in #10621/#10631:
- Leave as is — warning only. Default dbatools behavior for soft failures; scripts that care can use
-EnableException or check the (empty) return value.
- Make the bail-out louder without changing the contract — e.g. a clearly worded terminal warning stating that nothing was restored and why, instead of the current low-level "Fullname property not found".
- Treat it as an error even without
-EnableException. Most protective, but a behavior change for callers who deliberately point the command at possibly-empty paths.
Option 2 is cheap and helps every caller; whether to go further is the maintainers' call.
This issue was created by Claude and reviewed by Andreas Jordan.
Deferred from #10621 and PR #10631, which fixed the
-EnableExceptionhalf of the problem and explicitly left this half "for a maintainer decision". Since #10621 closes when that PR merges, the open half gets its own issue so it is not lost.Behavior after #10631
When the backup information pipeline selects nothing restorable — diff/log backups without a full to anchor the chain, or a path holding no backups at all:
-EnableException, the command now throws (that was Restore-DbaDatabase -EnableException restores nothing with only a warning when no full backup anchors the chain #10621, fixed);Select-DbaBackupInformation's stop degrades to a warning andRestore-DbaDatabasereturns nothing — a successful-looking no-op. A script that restores and then uses the database continues against a database that was never restored; the years-flakyGet-DbaDbRestoreHistorytests (Testing Get-DbaDbRestoreHistory - Give every backup its own file so the diff always finds its full #10620) were exactly this.Decision to make
Should the non-exception path also treat an empty selection as a failure rather than a warn-and-return? Options discussed in #10621/#10631:
-EnableExceptionor check the (empty) return value.-EnableException. Most protective, but a behavior change for callers who deliberately point the command at possibly-empty paths.Option 2 is cheap and helps every caller; whether to go further is the maintainers' call.
This issue was created by Claude and reviewed by Andreas Jordan.