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