diff --git a/examples/.vscode/launch.json b/examples/.vscode/launch.json index 4b77a9cf94..ef38b46228 100644 --- a/examples/.vscode/launch.json +++ b/examples/.vscode/launch.json @@ -4,7 +4,16 @@ { "type": "PowerShell", "request": "launch", - "name": "PowerShell Interactive Session" + "name": "PowerShell Launch (DebugTest.ps1)", + "script": "${workspaceRoot}/DebugTest.ps1", + "args": ["-Count 42 -DelayMilliseconds 1500"], + "cwd": "${workspaceRoot}" + }, + { + "type": "PowerShell", + "request": "launch", + "name": "PowerShell Interactive Session", + "cwd": "${workspaceRoot}" }, { "type": "PowerShell", diff --git a/examples/DebugTest.ps1 b/examples/DebugTest.ps1 index 6f14c1252a..478990bfd2 100644 --- a/examples/DebugTest.ps1 +++ b/examples/DebugTest.ps1 @@ -1,3 +1,5 @@ +param([int]$Count=50, [int]$DelayMilliseconds=200) + function Write-Item($itemCount) { $i = 1 @@ -10,7 +12,7 @@ function Write-Item($itemCount) { $i = $i + 1 # Slow down execution a bit so user can test the "Pause debugger" feature. - Start-Sleep -Milliseconds 200 + Start-Sleep -Milliseconds $DelayMilliseconds } } @@ -23,4 +25,4 @@ function Do-Work($workCount) { Write-Host "Done!" } -Do-Work 50 +Do-Work $Count