Skip to content

Expand-DbaDbLogFile - Add -TargetVlfCount parameter#10272

Open
andreasjordan wants to merge 2 commits intodevelopmentfrom
claude/issue-9835-20260320-1848
Open

Expand-DbaDbLogFile - Add -TargetVlfCount parameter#10272
andreasjordan wants to merge 2 commits intodevelopmentfrom
claude/issue-9835-20260320-1848

Conversation

@andreasjordan
Copy link
Collaborator

Adds a -TargetVlfCount parameter that calculates the optimal increment size to keep the total Virtual Log File count at or below the specified target.

Fixes #9835

Generated with Claude Code

Adds a -TargetVlfCount parameter that calculates an optimal increment size
to keep the total Virtual Log File count at or below the specified target.
Supports the SQL 2014+ 1-VLF-per-growth optimization when applicable.
Warns and skips databases where the target is already exceeded or impossible.

Fixes #9835

(do Expand-DbaDbLogFile)

Co-authored-by: Andreas Jordan <andreasjordan@users.noreply.github.com>
@andreasjordan
Copy link
Collaborator Author

@claude

Tests fail with:

ParserError: /Users/runner/work/dbatools/dbatools/public/Expand-DbaDbLogFile.ps1:547
Line |
 547 |  … vel Verbose -Message "$step - TargetVlfCount $TargetVlfCount: overrid …
     |                                                 ~~~~~~~~~~~~~~~~
     | Variable reference is not valid. ':' was not followed by a valid
     | variable name character. Consider using ${} to delimit the name.

Please fix the issue.

@claude
Copy link

claude bot commented Mar 20, 2026

Claude finished @andreasjordan's task in 40s —— View job


Fixed Parser Error

  • Identify the issue
  • Fix the variable reference on line 547
  • Commit and push

Root cause: On line 547, $TargetVlfCount: in a double-quoted string caused a parser error because PowerShell interprets the colon after a variable name as a scope modifier (e.g., $script:variable).

Fix: Changed $TargetVlfCount: to ${TargetVlfCount}: to delimit the variable name explicitly.
|

Use ${TargetVlfCount} instead of $TargetVlfCount: to avoid PowerShell
interpreting the colon as a scope modifier.

Co-authored-by: Andreas Jordan <andreasjordan@users.noreply.github.com>
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.

Expand-DbaDbLogFile: Add -TargetVlfCount Parameter

1 participant