-
Notifications
You must be signed in to change notification settings - Fork 500
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
Add "foreach
with Write-Progress
" snippet
#4423
Add "foreach
with Write-Progress
" snippet
#4423
Conversation
@microsoft-github-policy-service agree |
@microsoft-github-policy-service agree |
|
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.
Hey @ian-mor, is this still a work-in-progress or ready for review?
@andyleejordan, apologies. This is ready for review. |
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.
Looks good to me otherwise!
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.
Looks good to me otherwise!
@ian-mor thanks for your submission and sorry it took so long to get to. It looks pretty good to me, just a minor nit about where count should go. I also think "your code goes here" should be part of the final tabstop, so when you start typing it just replaces it, otherwise doing a bunch of snippets now sees a bunch of "your code goes here" comments. |
"Foreach ($${2:item} in $${1:array}) {", | ||
" \\$progPercent = \"{0:n2}\" -f ([math]::round(\\$i/\\$total,4) * 100)", | ||
" Write-Progress -Activity \"${3:activityName}\" -Status \"\\$i of \\$total - \\$progPercent% Complete:\" -PercentComplete \\$progPercent", | ||
" # Insert Code Here", |
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.
{0}
tabstop should include the Insert Code Here comment so when you start typing it overwrites it
f73c9ad
to
a544102
Compare
486e86e
to
ef038c8
Compare
@ian-mor @JustinGrote would love to get this in; is that last suggested change either blocking or something that could get merged in beforehand? |
I don't really recall but I don't think it's a deal breaker, especially since Snippets are just UI and we can always fix-forward. |
Co-authored-by: Justin Grote <JustinGrote@users.noreply.github.com>
foreach
with Write-Progress
" snippet
--------- Co-authored-by: Ian Morozoff <ian@ssfcu.org> Co-authored-by: Justin Grote <JustinGrote@users.noreply.github.com> Co-authored-by: Andy Jordan <2226434+andyleejordan@users.noreply.github.com>
PR Summary
Add a foreach loop snippet which includes Write-Progress already initialized. This helps streamline the setup and monitoring of a long-running process.
PR Checklist
Note: Tick the boxes below that apply to this pull request by putting an
x
between the square brackets.Please mark anything not applicable to this PR
NA
.WIP:
to the beginning of the title and remove the prefix when the PR is ready