Skip to content

Commit 9b18300

Browse files
committed
Fixed JSON
1 parent 18b7263 commit 9b18300

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

snippets/PowerShell.json

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -162,24 +162,23 @@
162162
]
163163
},
164164
"Foreach with Progress": {
165-
"prefix": "foreach-progress",
165+
"prefix": "foreach-progress",
166166
"description": "Insert a foreach loop with Write-Progress initialized",
167-
"body": [
168-
\\$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)",
174-
" Write-Progress -Activity \"${3:activityName}\" -Status \"\\$i of \\$total - \\$progPercent% Complete:\" -PercentComplete \\$progPercent",
175-
" # Insert Code Here",
176-
" ${0}",
177-
" ",
178-
" \\$i++",
179-
"}",
180-
""
181-
]
182-
},
167+
"body": [
168+
"\\$progPercent = \"{0:n2}\" -f ([math]::round(\\$i/\\$array.count,4) * 100)",
169+
"Write-Progress -Activity \"${3:activityName}\" -Status \"\\$i of \\$array.count - \\$progPercent% Complete:\" -PercentComplete \\$progPercent",
170+
"\\$i = 1",
171+
"foreach ($${2:item} in $${1:array}) {",
172+
" \\$progPercent = \"{0:n2}\" -f ([math]::round(\\$i/\\$total,4) * 100)",
173+
" Write-Progress -Activity \"${3:activityName}\" -Status \"\\$i of \\$total - \\$progPercent% Complete:\" -PercentComplete \\$progPercent",
174+
" # Insert Code Here",
175+
" ${0}",
176+
" ",
177+
" \\$i++",
178+
"}",
179+
""
180+
]
181+
},
183182
"ForEach-Object -Parallel": {
184183
"prefix": "foreach-parallel",
185184
"description": "[PS 7+] Process multiple objects in parallel using runspaces. This has some limitations compared to a regular ForEach-Object. More: Get-Help ForEach-Object",

0 commit comments

Comments
 (0)