Progress bars - Complete the bars that 22 commands left behind - #10660
Draft
andreasjordan wants to merge 1 commit into
Draft
Progress bars - Complete the bars that 22 commands left behind#10660andreasjordan wants to merge 1 commit into
andreasjordan wants to merge 1 commit into
Conversation
These commands started a progress bar with Write-Progress or Write-ProgressHelper and never completed it, so the bar stayed on screen after the command returned. Each one now completes its bar, using the pattern the rest of the module already uses. Commands that run a sequential and a parallel branch complete both, and the bars started with an explicit -Id are completed with that same Id. Remove-DbaNetworkCertificate also drops four -Target arguments passed to Write-ProgressHelper, which has no such parameter. The helper is a simple function, so the argument was silently landing in $args and doing nothing. (do Disable-DbaDbEncryption, Export-DbaUser, Find-DbaInstance, Import-DbaCsv, Import-DbaParquet, Install-DbaSqlWatch, Invoke-DbaDbDataGenerator, Invoke-DbaDbDataMasking, Invoke-DbaDbMirroring, New-DbaComputerCertificate, New-DbaComputerCertificateSigningRequest, New-DbatoolsSupportPackage, Read-DbaBackupHeader, Remove-DbaNetworkCertificate, Reset-DbaAdmin, Save-DbaDiagnosticQueryScript, Set-DbaNetworkCertificate, Start-DbaDbEncryption, Start-DbaMigration, Stop-DbaDbEncryption, Sync-DbaAvailabilityGroup, Sync-DbaLoginPermission) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft on purpose - this is the tactical half of the progress-bar topic, parked since 2026-08-10 while the structural RFC (#10548) waits for maintainer opinions. Opening it as a draft so it can be looked at without implying it should merge before that discussion.
What this fixes
An AST scan over the module found 22 commands that start a
Write-Progressbar and never complete it at all - on any path, success included. Their stale bars stay on screen until some later command happens to reuse the same progress Id, or the pipeline ends.This PR adds the missing
Write-Progress -Completedcalls: 25 completion calls across 22 commands, 30 insertions, no logic changes.What this deliberately does not fix
The second class found by the same scan: commands that complete their bar on the success path but leak it when they throw under
-EnableException(confirmed example:Add-DbaAgDatabase, whose completion sits after theforeachand whose 28Stop-Functioncalls all throw past it). That class needs a structural answer - completing bars from insideStop-Function, as proposed in #10548 - rather than 28 hand-placed completions, and is left out here on purpose.Scan notes for reviewers: a bar is identified by
-Id(default 0), not by its Activity text, so Activity mismatches are not leaks; andInvoke-Parallel.ps1is a permanent false positive for grep-based scans (the splat carries the Id, completed later).Testing
All 22 affected test files were run individually against the lab at the time the branch was built (2026-08-10): 171 passed, 0 failed, 7 pre-existing skips.
Write-Progresswrites zero bytes to stdout/stderr when redirected, so these calls cannot affect captured test output; CI additionally suppresses progress rendering via$ProgressPreferencein its runner scripts.The branch is based on development as of 2026-08-10; only one of the 22 files (
Set-DbaNetworkCertificate.ps1) has changed on development since, and the merge is conflict-free.References #10548.
created by Claude and reviewed by Andreas Jordan
馃 Generated with Claude Code