Repository navigation
Migrate REST API progress status to use Write-Progress - #167
Merged
Howard Wolosky (HowardWolosky) merged 1 commit intoMay 12, 2020
Merged
Conversation
When this module was originally written, it used a special feature of Write-Host in order to re-write the previously written line, in order to show the user an indeterminate waiting indicator while the module awaited a response from the server for a REST API request. Unfortunately, this doesn't work well with all PowerShell hosts (PowerShell ISE is one notable example). This approach had been taken originally as it had seemed odd to use Write-Progress (which displays an absolute progress percentage) for something where we didn't absolutely know the final duration. This change migrates the module over to use Write-Progress, and simply loops through the displayed percentage completed in the same manor that it loops through and shows an animation. This method should achieve the same desired goal (letting users know that something is happening and that they just need to wait a bit longer) in a more standards-approved way. Resolve microsoft#119
|
Sorry for letting this fall of my radar. Taking a brief look at implementation, I don't see where you send -Completed message to Write-Progress. This will cause progress bars to stay visible while any other commands in the script execute. E.g. if you ran a Get- that returned many results, and piped to an expensive Foreach-Object, your progress bar wouldn't go away until the Foreach-Object ended. Sorry to let this drift off the radar again. Thanks for improving your Write-Progress experience either way. |
Contributor
Author
|
Thanks for the feedback. Putting out a fix now. |
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.
When this module was originally written, it used a special feature
of Write-Host in order to re-write the previously written line, in
order to show the user an indeterminate waiting indicator while the
module awaited a response from the server for a REST API request.
Unfortunately, this doesn't work well with all PowerShell hosts
(PowerShell ISE is one notable example). This approach had been taken
originally as it had seemed odd to use Write-Progress (which displays
an absolute progress percentage) for something where we didn't absolutely
know the final duration.
This change migrates the module over to use Write-Progress, and simply
loops through the displayed percentage completed in the same manor that
it loops through and shows an animation.
This method should achieve the same desired goal (letting users know
that something is happening and that they just need to wait a bit
longer) in a more standards-approved way.
Resolves #119