forked from PowerShell/vscode-powershell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDebugTest.ps1
28 lines (22 loc) · 825 Bytes
/
DebugTest.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
param([int]$Count=50, [int]$DelayMilliseconds=200)
function Write-Item($itemCount) {
$i = 1
while ($i -le $itemCount) {
$str = "Output $i"
Write-Output $str
# In the gutter on the left, right click and select "Add Conditional Breakpoint"
# on the next line. Use the condition: $i -eq 25
$i = $i + 1
# Slow down execution a bit so user can test the "Pause debugger" feature.
Start-Sleep -Milliseconds $DelayMilliseconds
}
}
# Do-Work will be underlined in green if you haven't disable script analysis.
# Hover over the function name below to see the PSScriptAnalyzer warning that "Do-Work"
# doesn't use an approved verb.
function Do-Work($workCount) {
Write-Output "Doing work..."
Write-Item $workcount
Write-Host "Done!"
}
Do-Work $Count