-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Delay progress bar in Copy-Item and Remove-Item cmdlets #24013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I intend to remove the progressbar for less then or equal to 5 file, to make it less anoying TODO: Check for errors when running Remove-Item
Made it so that the progress bar for removing only appears after the _removeStopwatch reaches 600ms
Made the copy and remove command display the Progress bar only after the process is lasting more then 200ms
…econds Made it so that instead of skipping it all together, only the instance will not be shown until 3 seconds elapse, the calculations will still continue
Changed the Creating of the Progress Bar's instance to be after 3 seconds
src/System.Management.Automation/namespaces/FileSystemProvider.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/namespaces/FileSystemProvider.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/namespaces/FileSystemProvider.cs
Outdated
Show resolved
Hide resolved
Fixed Indentation for IF as Guidelines Say and Switched the Duration const to PascalCase
Fixed Indentation, Removed Empty Spaces, and Switched Const to PascalCase
|
@TheSpyGod if you don't want to agree to the CLA, I'll submit a new PR to address this |
SteveL-MSFT
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the indentation issue
|
@microsoft-github-policy-service agree |
|
@iSazonov can you take another look? I've pushed changes you've requested as I'd like to get this into 7.5 as it annoys me when doing small copies/removes. I've also reduced the threshold to 2 secs intead of 3. After building the branch privately, 3 secs seems way too long. |
iSazonov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ProgressBarDurationThreshold = 2.0;
Classic definition for interactive scenarios is 5 - 15 seconds. My personal preference is gold middle 10s for the constant. (Something like Exchange Server PowerShell console does.) Otherwise I expect users will see flapped lines. Nevertheless I merge the PR so we get early feedback and adjust the constant before release.
|
📣 Hey @TheSpyGod, how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://aka.ms/PSRepoFeedback |
|
@TheSpyGod Thanks for your contribution. |
|
This PR seems to have fixed #25679 and like @SteveL-MSFT mentions needs backporting to 7.5.x releases |
PR Summary
I've optimized the Progress Bar of the Copy and Remove commands to display only after the operation lasts more then 200ms, otherwise do the operation without a Progress Bar, I've done this by adding to the IF conditional of IF _copyStopwatch or _removeStopwatch Elapsed time is higher then 0.2 seconds(200ms) add the Progress Bar to the process.
PR Context
Fix #23831
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.- [ ] Issue filed:
(which runs in a different PS Host).