We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7222ba6 commit 995039eCopy full SHA for 995039e
snippets/PowerShell.json
@@ -165,7 +165,9 @@
165
"prefix": "foreach-progress",
166
"description": "Insert a foreach loop with Write-Progress initialized",
167
"body": [
168
- "\\$total = $${1:array}.count",
+\\$progPercent = \"{0:n2}\" -f ([math]::round(\\$i/\\$array.count,4) * 100)",
169
+
170
+Write-Progress -Activity \"${3:activityName}\" -Status \"\\$i of \\$array.count - \\$progPercent% Complete:\" -PercentComplete \\$progPercent",
171
"\\$i = 1",
172
"Foreach ($${2:item} in $${1:array}) {",
173
" \\$progPercent = \"{0:n2}\" -f ([math]::round(\\$i/\\$total,4) * 100)",
0 commit comments