Skip to content

Opening VS Code via PowerShell script (.ps1) launches two instances instead of one #311187

@shhafiz

Description

@shhafiz

!-- bug_report_template -->
Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.116.0
    • OS Version: Windows 11
      • PowerShell Version: 5.1.26100.8115

Description

When opening VS Code using a custom PowerShell script (.ps1), two instances of VS Code are launched instead of one. No error messages are displayed.

Steps to Reproduce

  1. Create a PowerShell script (.ps1) that opens VS Code (e.g., using code . or Start-Process code)
    1. Execute the .ps1 script from a PowerShell terminal
    1. Observe that two separate VS Code windows open instead of the expected single instance

Expected Behavior

Running the .ps1 script should open exactly one instance of VS Code.

Actual Behavior

Two instances of VS Code are opened. No error messages are shown in the terminal or in VS Code.

Environment

  • VS Code: 1.116.0
    • OS: Windows 11
      • PowerShell: 5.1 (Build 26100.8115)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions