PowerShell / PowerShell/vscode-powershell

Conditional breakpoints not working in remote sessions

Open
#2,295 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.9k
Forks
547
PR merge metrics
No merged PRs in 30d

Description

Issue Description

I am experiencing a problem with conditional breakpoints not working in remote sessions.

To reproduce:
Enter-PSSession -ComputerName srv01

psedit C:\temp\demo.ps1

Set a conditional breakpoint such as $i -eq 42
Run script (F5)

The following message is present when the script is running:

[SRV01]: PS C:\Users\admin\Documents> Cannot bind parameter 'Action'. Cannot convert the "if ($i -eq 14) { break }" value of type "System.String" to type "System.Management.Automation.ScriptBlock".
At line:0 char:0

The same conditional breakpoint works fine when running the same script locally.

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.18363
VSCode 1.40.0
PowerShell Extension Version 2019.11.0

PowerShell Information

Name Value
PSVersion 6.2.3
PSEdition Core
GitCommitId 6.2.3
OS Microsoft Windows 10.0.18363
Platform Win32NT
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.10032.0 6.2.3
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
azure-account ms-vscode 0.8.7
azure-pipelines ms-azure-devops 1.157.4
azurecli ms-vscode 0.4.6
azurerm-vscode-tools msazurermtools 0.8.2
bracket-pair-colorizer-2 CoenraadS 0.0.28
code-settings-sync Shan 3.4.3
gitblame waderyan 3.0.1
githistory donjayamanne 0.4.6
gitlens eamodio 10.1.2
guides spywhere 0.9.3
indent-rainbow oderwat 7.4.0
markdown-all-in-one yzhang 2.5.1
material-icon-theme PKief 3.9.1
night-owl sdras 1.1.3
powershell-preview ms-vscode 2019.11.0
python ms-python 2019.10.44104
rainbow-csv mechatroner 1.3.1
remote-containers ms-vscode-remote 0.83.0
remote-wsl ms-vscode-remote 0.40.2
shell-launcher Tyriar 0.3.0
swagger-viewer Arjun 2.2.2
team ms-vsts 1.161.0
terraform mauve 1.4.0
vscode-azureappservice ms-azuretools 0.16.1
vscode-azurefunctions ms-azuretools 0.20.0
vscode-azurestorage ms-azuretools 0.7.2
vscode-azureterraform ms-azuretools 0.3.0
vscode-coverage-gutters ryanluker 2.4.2
vscode-instant-markdown dbankier 1.4.4
vscode-logicapps ms-azuretools 0.2.22
vscode-markdownlint DavidAnson 0.31.2
vscode-pandoc DougFinke 0.0.8
vscode-peacock johnpapa 3.2.0
vscode-todo-highlight wayou 1.0.4
vsliveshare ms-vsliveshare 1.0.1123

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with Enter-PSSession, psedit, and a conditional breakpoint in the remote PowerShell session. Trace the remote conditional-breakpoint handling from that reproduction; done means the condition executes as a ScriptBlock and the breakpoint works without the parameter-binding error.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.