Skip to content

Add params to DebugTest.ps1. #485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion examples/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions examples/DebugTest.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
param([int]$Count=50, [int]$DelayMilliseconds=200)

function Write-Item($itemCount) {
$i = 1

Expand All @@ -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
}
}

Expand All @@ -23,4 +25,4 @@ function Do-Work($workCount) {
Write-Host "Done!"
}

Do-Work 50
Do-Work $Count