|
166 | 166 | "description": "Insert a foreach loop with Write-Progress initialized",
|
167 | 167 | "body": [
|
168 | 168 | "\\$total = \\$${1:array}.count",
|
| 169 | + "\\$i = 1", |
169 | 170 | "\\$progPercent = \"{0:n2}\" -f ([math]::round(\\$i/\\$total,4) * 100)",
|
170 | 171 | "Write-Progress -Activity \"${3:activityName}\" -Status \"\\$i of \\$total - \\$progPercent% Complete:\" -PercentComplete \\$progPercent",
|
171 | | - "\\$i = 1", |
172 | 172 | "foreach ($${2:item} in $${1:array}) {",
|
173 | 173 | " \\$progPercent = \"{0:n2}\" -f ([math]::round(\\$i/\\$total,4) * 100)",
|
174 | 174 | " Write-Progress -Activity \"${3:activityName}\" -Status \"\\$i of \\$total - \\$progPercent% Complete:\" -PercentComplete \\$progPercent",
|
|
0 commit comments