René's URL Explorer Experiment


Title: Ignore file path validation on Set-PSBreakpoint for attach scenarios · Issue #2243 · PowerShell/PowerShellEditorServices · GitHub

Open Graph Title: Ignore file path validation on Set-PSBreakpoint for attach scenarios · Issue #2243 · PowerShell/PowerShellEditorServices

X Title: Ignore file path validation on Set-PSBreakpoint for attach scenarios · Issue #2243 · PowerShell/PowerShellEditorServices

Description: Prerequisites I have written a descriptive issue title. I have searched all issues to ensure it has not already been requested. Summary I would live to avoid the file path validation that occurs when PSES sets a breakpoint on PowerShell ...

Open Graph Description: Prerequisites I have written a descriptive issue title. I have searched all issues to ensure it has not already been requested. Summary I would live to avoid the file path validation that occurs wh...

X Description: Prerequisites I have written a descriptive issue title. I have searched all issues to ensure it has not already been requested. Summary I would live to avoid the file path validation that occurs wh...

Opengraph URL: https://github.com/PowerShell/PowerShellEditorServices/issues/2243

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Ignore file path validation on Set-PSBreakpoint for attach scenarios","articleBody":"### Prerequisites\n\n- [x] I have written a descriptive issue title.\n- [x] I have searched all [issues](https://github.com/PowerShell/PowerShellEditorServices/issues?q=is%3Aissue) to ensure it has not already been requested.\n\n### Summary\n\nI would live to avoid the file path validation that occurs when PSES sets a breakpoint on PowerShell 5.1. There is an API split where PowerShell 5.1 uses the [Set-PSBreakpoint](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/set-psbreakpoint?view=powershell-7.5) to set a line breakpoint whereas 7.x uses the PSRemoting based `__Set-PSBreakpoint` command which is treated specially by the server. The 7.x API does not do any validation on the file path whereas `Set-PSBreakpoint` used by 5.1 will fail if the path does not exist.\n\nFor an attach scenario, PSES could be attaching itself to a runspace where the scriptblocks are set to a path that may or may not exist, e.g.\n\n```powershell\n$sbk = [System.Management.Automation.Language.Parser]::ParseInput(\n    '$PSCommandPath',\n    'foo.ps1',\n    [ref]$null,\n    [ref]$null).GetScriptBlock()\n\n\u0026 $sbk  # foo.ps1\n```\n\nIn the above case the script could be multiple lines and while 7.x will be able to set breakpoints on any of lines by targeting `foo.ps1` as the script, WinPS 5.1 will fail because `foo.ps1` does not exist.\n\n### Proposed Design\n\nWe can implement this by not calling `Set-PSBreakpoint` in the 5.1 fallback path.\n\nhttps://github.com/PowerShell/PowerShellEditorServices/blob/6bb322ec2150ed341991ffc7db7180db7a49539d/src/PowerShellEditorServices/Services/DebugAdapter/BreakpointService.cs#L117-L120\n\nInstead we could do something like\n\n```csharp\nnamespace Microsoft.PowerShell.EditorServices.Services\n{\n    internal class BreakpointService\n    {\n        private readonly string _setPsBreakpointScript = \"\"\"\n            [CmdletBinding()]\n            param (\n                [Parameter(Mandatory)]\n                [string]\n                $Script,\n\n                [Parameter()]\n                [int]\n                $Line,\n\n                [Parameter()]\n                [int]\n                $Column,\n\n                [Parameter()]\n                [ScriptBlock]\n                $Action\n            )\n\n            $lineCtor = [System.Management.Automation.LineBreakpoint].GetConstructor(\n                [System.Reflection.BindingFlags]'NonPublic, Instance',\n                $null,\n                [type[]]@([string], [int], [int], [scriptblock]),\n                $null)\n\n            $b = $lineCtor.Invoke(@($Script, $Line, $Column, $Action))\n            [Runspace]::DefaultRunspace.Debugger.SetBreakpoints(\n                [System.Management.Automation.Breakpoint[]]@($b))\n\n            $b\n            \"\"\";\n\n            ...\n\n            // In SetBreakpointsAsync\n            // Instead of psCommand.AddCommand(...) do this instead\n            psCommand\n                .AddScript(_setPsBreakpointScript, useLocalScope: true)\n                .AddParameter(\"Script\", escapedScriptPath)\n                .AddParameter(\"Line\", breakpoint.LineNumber);\n```\n\nThis uses a small bit of reflection to build the [LineBreakpoint](https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.linebreakpoint?view=powershellsdk-7.4.0) object which did not have a public constructor in 5.1. While reflection isn't great, 5.1 is mostly an EOL product and newer versions will be using the public API so we shouldn't have any future breakage issues.","author":{"url":"https://github.com/jborean93","@type":"Person","name":"jborean93"},"datePublished":"2025-07-23T03:53:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/2243/PowerShellEditorServices/issues/2243"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:997154a5-90c2-ff48-36da-c6cc61d1207c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB0D0:7C839:161847A:1F91DA1:6A58D149
html-safe-nonceeff3068be690a20aaf0bfb460cba1579c354142b5aef7100ba11e506a109160c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEQwOjdDODM5OjE2MTg0N0E6MUY5MURBMTo2QTU4RDE0OSIsInZpc2l0b3JfaWQiOiI3ODM3NjUwODY0MDY4Njc3OTYxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac2faf5e058ad3ab543b55402dc02d5c21985b67148fc147bbcd8ff8117601eeda
hovercard-subject-tagissue:3254745074
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShellEditorServices/2243/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8c28193a30567955defc0d048cd5d8232286d343d41a622b8328c2b69261357e/PowerShell/PowerShellEditorServices/issues/2243
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8c28193a30567955defc0d048cd5d8232286d343d41a622b8328c2b69261357e/PowerShell/PowerShellEditorServices/issues/2243
og:image:altPrerequisites I have written a descriptive issue title. I have searched all issues to ensure it has not already been requested. Summary I would live to avoid the file path validation that occurs wh...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejborean93
hostnamegithub.com
expected-hostnamegithub.com
None5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6
turbo-cache-controlno-preview
go-importgithub.com/PowerShell/PowerShellEditorServices git https://github.com/PowerShell/PowerShellEditorServices.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id36031537
octolytics-dimension-repository_nwoPowerShell/PowerShellEditorServices
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36031537
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShellEditorServices
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/PowerShell/PowerShellEditorServices/issues/2243#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShellEditorServices%2Fissues%2F2243
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShellEditorServices%2Fissues%2F2243
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=PowerShell%2FPowerShellEditorServices
Reloadhttps://github.com/PowerShell/PowerShellEditorServices/issues/2243
Reloadhttps://github.com/PowerShell/PowerShellEditorServices/issues/2243
Reloadhttps://github.com/PowerShell/PowerShellEditorServices/issues/2243
Please reload this pagehttps://github.com/PowerShell/PowerShellEditorServices/issues/2243
PowerShell https://github.com/PowerShell
PowerShellEditorServiceshttps://github.com/PowerShell/PowerShellEditorServices
Notifications https://github.com/login?return_to=%2FPowerShell%2FPowerShellEditorServices
Fork 261 https://github.com/login?return_to=%2FPowerShell%2FPowerShellEditorServices
Star 759 https://github.com/login?return_to=%2FPowerShell%2FPowerShellEditorServices
Code https://github.com/PowerShell/PowerShellEditorServices
Issues 127 https://github.com/PowerShell/PowerShellEditorServices/issues
Pull requests 14 https://github.com/PowerShell/PowerShellEditorServices/pulls
Actions https://github.com/PowerShell/PowerShellEditorServices/actions
Security and quality 0 https://github.com/PowerShell/PowerShellEditorServices/security
Insights https://github.com/PowerShell/PowerShellEditorServices/pulse
Code https://github.com/PowerShell/PowerShellEditorServices
Issues https://github.com/PowerShell/PowerShellEditorServices/issues
Pull requests https://github.com/PowerShell/PowerShellEditorServices/pulls
Actions https://github.com/PowerShell/PowerShellEditorServices/actions
Security and quality https://github.com/PowerShell/PowerShellEditorServices/security
Insights https://github.com/PowerShell/PowerShellEditorServices/pulse
#2248https://github.com/PowerShell/PowerShellEditorServices/pull/2248
Ignore file path validation on Set-PSBreakpoint for attach scenarioshttps://github.com/PowerShell/PowerShellEditorServices/issues/2243#top
#2248https://github.com/PowerShell/PowerShellEditorServices/pull/2248
Issue-EnhancementA feature request (enhancement).https://github.com/PowerShell/PowerShellEditorServices/issues?q=state%3Aopen%20label%3A%22Issue-Enhancement%22
Needs: TriageMaintainer attention needed!https://github.com/PowerShell/PowerShellEditorServices/issues?q=state%3Aopen%20label%3A%22Needs%3A%20Triage%22
https://github.com/jborean93
jborean93https://github.com/jborean93
on Jul 23, 2025https://github.com/PowerShell/PowerShellEditorServices/issues/2243#issue-3254745074
issueshttps://github.com/PowerShell/PowerShellEditorServices/issues?q=is%3Aissue
Set-PSBreakpointhttps://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/set-psbreakpoint?view=powershell-7.5
PowerShellEditorServices/src/PowerShellEditorServices/Services/DebugAdapter/BreakpointService.cshttps://github.com/PowerShell/PowerShellEditorServices/blob/6bb322ec2150ed341991ffc7db7180db7a49539d/src/PowerShellEditorServices/Services/DebugAdapter/BreakpointService.cs#L117-L120
6bb322ehttps://github.com/PowerShell/PowerShellEditorServices/commit/6bb322ec2150ed341991ffc7db7180db7a49539d
LineBreakpointhttps://learn.microsoft.com/en-us/dotnet/api/system.management.automation.linebreakpoint?view=powershellsdk-7.4.0
Issue-EnhancementA feature request (enhancement).https://github.com/PowerShell/PowerShellEditorServices/issues?q=state%3Aopen%20label%3A%22Issue-Enhancement%22
Needs: TriageMaintainer attention needed!https://github.com/PowerShell/PowerShellEditorServices/issues?q=state%3Aopen%20label%3A%22Needs%3A%20Triage%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.