Skip to content

Various bug fixes and hooks#10346

Open
potatoqualitee wants to merge 145 commits intodevelopmentfrom
gptreview
Open

Various bug fixes and hooks#10346
potatoqualitee wants to merge 145 commits intodevelopmentfrom
gptreview

Conversation

@potatoqualitee
Copy link
Copy Markdown
Member

I used a dedicated session per commit and asked Opus to fix any potential bugs, since you were concerned @andreasjordan. Unfortunately/fortunately it also cleaned up the coding style which is great but makes it harder to review.

potatoqualitee and others added 30 commits April 10, 2026 00:25
(do Copy-DbaDbMail)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…(review of #10156)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…0158)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… of #10159)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ew of #10160)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…10163)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…view of #10165)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…on (review of #10167)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…0173)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…iew of #10176)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…0174)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#10247

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
#10162)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…idation (review of #10178)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…es (review of #10182)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…10185)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… of #10186)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ew of #10187)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#10191)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…iew of #10190)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
potatoqualitee and others added 29 commits April 10, 2026 19:58
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…eview of #10296)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ew of #10316)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(do Stop-Function)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…iew of #10318)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… passthrough (review of #10317)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…10321)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…(review of #10319)

Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com>
…10311)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
On Windows PowerShell 5.1, a single PSCustomObject returned from a pipeline
does not expose a .Count property, so $obj.Count is $null instead of 1. The
review commits introduced code paths where post-filter results could be a
single object, which unmasked several latent issues on the AppVeyor 5.1 leg
while still passing on PowerShell 7.

- Invoke-DbaBalanceDataFiles: use $tbl.Indexes (not $tableCollection.Indexes)
  and wrap the clustered-index filter in @() so .Count works on 5.1.
- Get-DbaDbOrphanUser: wrap $DatabaseCollection pipeline results in @() so
  the .Count guard still evaluates when a single accessible db is returned.
- Invoke-DbaDbPiiScan: wrap $tables in @() after each filter step and skip
  progress reporting when no tables remain to avoid divide-by-zero.
- Export-DbaLogin.Tests: replace C# 6 auto-property initializers with
  parameterless constructors since PS 5.1 Add-Type uses a C# 5 compiler.

(do Invoke-DbaBalanceDataFiles, Get-DbaDbOrphanUser, Invoke-DbaDbPiiScan, Export-DbaLogin)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ConvertTo-DbaTimeline: Add backslash escaping to DatabaseName for JS output
- Compare-DbaLogin.Tests: Wrap result in @() for PS 5.1 .Count compatibility
- Start-DbaMigration.Tests: Wrap Where-Object result in @() for PS 5.1 .Count
- Update-ServiceStatus: Fix severely broken indentation throughout file

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Wrap $script:ssisCalls and Where-Object results in @() for PS 5.1
compatibility where .Count returns $null on single objects.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Set TrustDbBackupHistory to true for -Path workflow since backup
history objects from Get-DbaBackupInformation are valid and should
not be re-processed. Fixes type conversion issue where Select-Object
converts BackupHistory to PSCustomObject, causing Restore-DbaDatabase
to misinterpret them as file paths.

(do Test-DbaLastBackup)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… blocks

When Export-DbaCredential fails during test setup (e.g., connection reset),
the test continued and failed on Get-Content with a misleading "file not found"
error. Adding EnableException ensures setup failures throw immediately with
the actual error message.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add PreToolUse hook to validate PowerShell style (backticks, attributes, alignment)
- Add Pre-Tool hooks for git safety (prevent destructive operations)
- Add Stop hooks for quality gates (TODO detection, verification)
- Add .claude/settings.json to wire hooks for Edit/Write/Bash tools
- Remove duplicate entries for .claude directories
- Remove obsolete script/tracker files
- Add .claude/settings.local.json
- Normalize whitespace
- Add check to skip processing if destServer is null after connection
- Prevents null reference errors when destination server connection fails
- Improves robustness when connecting to unavailable instances
@andreasjordan
Copy link
Copy Markdown
Collaborator

There are way too many changes to have a closer look. But in general the changes look ok, so maybe release them with a notice.

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.

2 participants