Skip to content

Import-DbaBinaryFile - Stop eating the caller loop on FilePath validation - #10646

Open
andreasjordan wants to merge 1 commit into
developmentfrom
fix-importdbabinaryfile-continue-escape
Open

Import-DbaBinaryFile - Stop eating the caller loop on FilePath validation#10646
andreasjordan wants to merge 1 commit into
developmentfrom
fix-importdbabinaryfile-continue-escape

Conversation

@andreasjordan

Copy link
Copy Markdown
Collaborator

Summary

Tenth fix from the #10638 inventory. The two -FilePath guards (file missing, path is a directory) called Stop-Function -Continue with no enclosing loop - the escape ate an iteration of the caller's loop. The guards directly above them already use the correct stop-and-return form; these two now match.

Tests

Loop-counter regression test over a nonexistent -FilePath: red on the unfixed command ("Expected 3, but got 0"), green on the fix via the lab harness on SQL03\SQL2019, lab left clean.

References #10638

created by Claude and reviewed by Andreas Jordan

🤖 Generated with Claude Code

…tion

The two FilePath guards called Stop-Function -Continue, but no loop
encloses them: without -EnableException the continue escaped the
command and consumed an iteration of whatever loop the caller was
running in. The guards directly above (missing Path/FilePath, Path not
a container) already stop and return - these two now do the same.

Part of the #10638 inventory. Verified via the lab harness: all tests
green including the connection-ownership contexts, lab left clean; the
unfixed command fails the new loop-counter test with "Expected 3, but
got 0".

References #10638

(do Import-DbaBinaryFile)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@potatoqualitee potatoqualitee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the complete current head, both validation guards, regression coverage, and exact-head CI evidence. No material correctness or compatibility issues found.

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