-
Notifications
You must be signed in to change notification settings - Fork 237
Add Start-DebugAttachSession function #2249
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
base: main
Are you sure you want to change the base?
Conversation
Adds the `Start-DebugAttachSession` cmdlet which can be used to launch a new attach session debug request inside an existing launched debug session. This allows a script being debugged to launch a child debugging session using more dynamic environment information without requiring end users to manually setup the launch.json configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds the Start-DebugAttachSession
cmdlet that enables launching a new attach session debug request from within an existing debug session. This allows scripts to dynamically start child debugging sessions without requiring manual launch.json configuration.
Key changes:
- Added new
Start-DebugAttachSession
PowerShell function with comprehensive parameter support - Implemented debug server variable management for session lifecycle
- Added comprehensive documentation and examples
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
LaunchAndAttachHandler.cs | Sets global debug server variable during launch for child session access |
DisconnectHandler.cs | Cleans up debug server variable on disconnect for non-attach sessions |
DebugService.cs | Defines constant for debug server variable name |
Start-DebugAttachSession.ps1 | Main cmdlet implementation with parameter validation and debug request handling |
Start-DebugAttachSession.md | Comprehensive documentation with examples and parameter descriptions |
PowerShellEditorServices.Commands.md | Updates module documentation to include new cmdlet |
PowerShellEditorServices.Commands.psd1 | Exports new function in module manifest |
module/PowerShellEditorServices/Commands/Public/Start-DebugAttachSession.ps1
Outdated
Show resolved
Hide resolved
module/PowerShellEditorServices/Commands/Public/Start-DebugAttachSession.ps1
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
PR Summary
Adds the
Start-DebugAttachSession
cmdlet which can be used to launch a new attach session debug request inside an existing launched debug session. This allows a script being debugged to launch a child debugging session using more dynamic environment information without requiring end users to manually setup the launch.json configuration.PR Context
Fixes: #2244
Examples added with: PowerShell/vscode-powershell#5246