Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Debugger Issues #3522

Closed
PowerShell/PowerShellEditorServices
#1685
@strickdd

Description

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.

Summary

REF: #3394 (comment)

After attempting to resolve my issue with the pre-release version of the extension, the debugger started failing again. Per @rjmholt 's suggestion, I am opening a new issue for tracking.

PowerShell Version

Both PS 5.1 and 7 have issues.
Name Value
---- -----
PSVersion 7.1.0
PSEdition Core
GitCommitId 7.1.0
OS Microsoft Windows 10.0.18363
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Name Value 
---- ----- 
PSVersion 5.1.18362.1474 
PSEdition Desktop 
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} 
BuildVersion 10.0.18362.1474 
CLRVersion 4.0.30319.42000 
WSManStackVersion 3.0 
PSRemotingProtocolVersion 2.3 
SerializationVersion 1.1.0.1

Visual Studio Code Version

1.59.1
3866c3553be8b268c8a7f8c0482c0c0177aa8bfa
x64

Extension Version

ms-vscode.powershell@202180
ms-vscode.powershell-preview@2021年8月1日

Steps to Reproduce

Scenario 1 (PowerShell 5.1)

  1. Close all VSCode instances
  2. Open new instance with no folder opened
  3. Create a new PowerShell script
  4. Past in script below (do not save)
function Write-SomeStatus {
 # Breakpoint on following line
 Write-Host 'Some Status'
}
Write-SomeStatus
  1. Press F5

Expected: Breakpoint is hit
Actual: Breakpoint is skipped and script contents + "Some Status" is written to terminal

Scenario 2 (PowerShell 5.1)

  1. Save the script from Scenario 1 to C:\temp\DebuggingTest.ps1
  2. Readd the breakpoint to line 3 (as indicated)
  3. Press F5
  4. Debugger starts and attaches correctly
  5. Press F5 to run to completion
  6. Run Write-SomeStatus from the terminal directly
  7. Debugger attaches to breakpoint at line 3
  8. Press F5 to continue and the debugger hangs (screenshot below)

Visuals

Debugger attaches when adding new Write-Host line:
image

Debugger hangs after calling from terminal directly:
image

Logs

EditorServices.log
StartEditorServices.log
vscode-powershell.log

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /