René's URL Explorer Experiment


Title: Get-ConciseViewPositionMessage throws ArgumentOutOfRangeException in some cases · Issue #11976 · PowerShell/PowerShell · GitHub

Open Graph Title: Get-ConciseViewPositionMessage throws ArgumentOutOfRangeException in some cases · Issue #11976 · PowerShell/PowerShell

X Title: Get-ConciseViewPositionMessage throws ArgumentOutOfRangeException in some cases · Issue #11976 · PowerShell/PowerShell

Description: Steps to reproduce Create a C:\temp\repro.ps1 file with the following content: $global:ErrorView = 'ConciseView' # NormalView and CategoryView work as expected # Bug happens when the path is >= 128 characters long. # Shorten path to < 12...

Open Graph Description: Steps to reproduce Create a C:\temp\repro.ps1 file with the following content: $global:ErrorView = 'ConciseView' # NormalView and CategoryView work as expected # Bug happens when the path is >= 128...

X Description: Steps to reproduce Create a C:\temp\repro.ps1 file with the following content: $global:ErrorView = 'ConciseView' # NormalView and CategoryView work as expected # Bug happens when the path i...

Opengraph URL: https://github.com/PowerShell/PowerShell/issues/11976

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Get-ConciseViewPositionMessage throws ArgumentOutOfRangeException in some cases","articleBody":"# Steps to reproduce\r\n\r\n1. Create a `C:\\temp\\repro.ps1` file with the following content:\r\n\r\n```powershell\r\n$global:ErrorView = 'ConciseView' # NormalView and CategoryView work as expected\r\n\r\n# Bug happens when the path is >= 128 characters long.\r\n# Shorten path to \u003c 128 characters and it works as expected.\r\nResolve-Path -LiteralPath 'C:\\really\\long\\path\\that\\does\\not\\exist\\but\\is\\exactly\\128\\characters\\long\\and\\breaks\\the\\world\\which\\is\\not\\great.oops.2bad.exe'\r\n```\r\n\r\n2. Open a PowerShell 7 RC3 prompt\r\n3. Run this command `c:\\temp\\repro.ps1`\r\n\r\n# Expected behavior\r\n\r\nConcise error view should be shown:\r\n\r\n```none\r\nResolve-Path: C:\\temp\\repro.ps1:5\r\nLine |\r\n   5 |  Resolve-Path -LiteralPath 'C:\\really\\long\\path\\that\\does\\not\\exist\\bu …\r\n     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n     | Cannot find path\r\n     | 'C:\\really\\long\\path\\that\\does\\not\\exist\\but\\i\\exactly\\128\\characters\\long\\and\\breaks\\the\\world\\which\\is\\not\\great.oops.2bad.exe'\r\n     | because it does not exist.\r\n```\r\n\r\n# Actual behavior\r\n\r\n* No error is written to the host.\r\n* `$? = True`\r\n* `Get-Error` returns information about an exception thrown by `Get-ConciseViewPositionMessage`.\r\n\r\n```none\r\nException             :\r\n    Type           : System.Management.Automation.MethodInvocationException\r\n    ErrorRecord    :\r\n        Exception             :\r\n            Type    : System.Management.Automation.ParentContainsErrorRecordException\r\n            Message : Exception calling \"Substring\" with \"1\" argument(s): \"StartIndex cannot be less than zero. (Parameter 'startIndex')\"\r\n            HResult : -2146233087\r\n        CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException\r\n        FullyQualifiedErrorId : ArgumentOutOfRangeException\r\n        InvocationInfo        :\r\n            ScriptLineNumber : 171\r\n            OffsetInLine     : 53\r\n            HistoryId        : -1\r\n            Line             : $remainingMessage = $remainingMessage.Substring($substring.Length - $prefix.Length).Trim()\r\n\r\n            PositionMessage  : At line:171 char:53\r\n                               + …             $remainingMessage = $remainingMessage.Substring($substrin …\r\n                               +               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n            CommandOrigin    : Internal\r\n        ScriptStackTrace      : at Get-ConciseViewPositionMessage, \u003cNo file>: line 171\r\n                                at \u003cScriptBlock>, \u003cNo file>: line 227\r\n                                at \u003cScriptBlock>, C:\\temp\\repro.ps1: line 5\r\n                                at \u003cScriptBlock>, \u003cNo file>: line 1\r\n    TargetSite     :\r\n        Name          : CheckActionPreference\r\n        DeclaringType : System.Management.Automation.ExceptionHandlingOps, System.Management.Automation, Version=7.0.0.0, Culture=neutral,\r\nPublicKeyToken=31bf3856ad364e35\r\n        MemberType    : Method\r\n        Module        : System.Management.Automation.dll\r\n    StackTrace     :\r\n   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)\r\n   at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)\r\n   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)\r\n   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)\r\n   at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)\r\n   at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)\r\n   at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope,\r\nDictionary`2 functionsToDefine, List`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object\r\nscriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)\r\n   at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object\r\ndollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Boolean propagateAllExceptionsToTop, List`1\r\nvariablesToDefine, Dictionary`2 functionsToDefine, Object[] args)\r\n   at System.Management.Automation.ScriptBlock.DoInvokeReturnAsIs(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object\r\ndollarUnder, Object input, Object scriptThis, Object[] args)\r\n   at Microsoft.PowerShell.Commands.PSPropertyExpression.GetValue(PSObject target, Boolean eatExceptions)\r\n    Message        : Exception calling \"Substring\" with \"1\" argument(s): \"StartIndex cannot be less than zero. (Parameter 'startIndex')\"\r\n    Data           : System.Collections.ListDictionaryInternal\r\n    InnerException :\r\n        Type       : System.ArgumentOutOfRangeException\r\n        Message    : StartIndex cannot be less than zero. (Parameter 'startIndex')\r\n        ParamName  : startIndex\r\n        TargetSite :\r\n            Name          : Substring\r\n            DeclaringType : string\r\n            MemberType    : Method\r\n            Module        : System.Private.CoreLib.dll\r\n        StackTrace :\r\n   at System.String.Substring(Int32 startIndex, Int32 length)\r\n   at CallSite.Target(Closure , CallSite , Object , Object )\r\n        Source     : System.Private.CoreLib\r\n        HResult    : -2146233086\r\n    Source         : System.Management.Automation\r\n    HResult        : -2146233087\r\nCategoryInfo          : NotSpecified: (:) [], MethodInvocationException\r\nFullyQualifiedErrorId : ArgumentOutOfRangeException\r\nInvocationInfo        :\r\n    ScriptLineNumber : 171\r\n    OffsetInLine     : 53\r\n    HistoryId        : -1\r\n    Line             : $remainingMessage = $remainingMessage.Substring($substring.Length - $prefix.Length).Trim()\r\n\r\n    PositionMessage  : At line:171 char:53\r\n                       + …             $remainingMessage = $remainingMessage.Substring($substrin …\r\n                       +               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    CommandOrigin    : Internal\r\nScriptStackTrace      : at Get-ConciseViewPositionMessage, \u003cNo file>: line 171\r\n                        at \u003cScriptBlock>, \u003cNo file>: line 227\r\n                        at \u003cScriptBlock>, C:\\temp\\repro.ps1: line 5\r\n                        at \u003cScriptBlock>, \u003cNo file>: line 1\r\n```\r\n\r\n# Environment data\r\n\r\n```none\r\nName                           Value\r\n----                           -----\r\nPSVersion                      7.0.0-rc.3\r\nPSEdition                      Core\r\nGitCommitId                    7.0.0-rc.3\r\nOS                             Microsoft Windows 10.0.17763\r\nPlatform                       Win32NT\r\nPSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion      2.3\r\nSerializationVersion           1.1.0.1\r\nWSManStackVersion              3.0\r\n```\r\n","author":{"url":"https://github.com/jpoehls","@type":"Person","name":"jpoehls"},"datePublished":"2020-02-28T18:35:12Z","url":"https://github.com/PowerShell/PowerShell/issues/11976"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d325b177-75d5-7089-a5e7-c14152569897
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDE84:2258C3:1745C1:1FB075:6AFD4E60
html-safe-nonceeada478d94dce1c3c85e894118c96317359ab6d4e307b2adcd56c671e24fe3bc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTg0OjIyNThDMzoxNzQ1QzE6MUZCMDc1OjZBRkQ0RTYwIiwidmlzaXRvcl9pZCI6IjI2NDY5MzU0OTY3NDcyMDgyODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac8b660b079bf97fa05dcaf4fe8f8172e98f63457bbf2a75bfd683ba35a42fdf1e
hovercard-subject-tagissue:572931489
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/PowerShell/11976/issue_layout
twitter:imagehttps://opengraph.githubassets.com/bfed3253ac46924d7f93b5d35e7cf1ac964ccd15931fdd1716ee87993841d3f7/PowerShell/PowerShell/issues/11976
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/bfed3253ac46924d7f93b5d35e7cf1ac964ccd15931fdd1716ee87993841d3f7/PowerShell/PowerShell/issues/11976
og:image:altSteps to reproduce Create a C:\temp\repro.ps1 file with the following content: $global:ErrorView = 'ConciseView' # NormalView and CategoryView work as expected # Bug happens when the path is >= 128...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejpoehls
hostnamegithub.com
expected-hostnamegithub.com
None66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e
turbo-cache-controlno-preview
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
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
releaseb6f01f7cb9f35f8c09949773241a3d49dd04b340
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/11976#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F11976
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F11976
Sign uphttps://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%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/issues/11976
Reloadhttps://github.com/PowerShell/PowerShell/issues/11976
Reloadhttps://github.com/PowerShell/PowerShell/issues/11976
PowerShellhttps://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Codehttps://github.com/PowerShell/PowerShell
Issues1.3k (1.3k)https://github.com/PowerShell/PowerShell/issues
Pull requests365 (365)https://github.com/PowerShell/PowerShell/pulls
Discussionshttps://github.com/PowerShell/PowerShell/discussions
Actionshttps://github.com/PowerShell/PowerShell/actions
Projectshttps://github.com/PowerShell/PowerShell/projects
Security and quality3 (3)https://github.com/PowerShell/PowerShell/security
Insightshttps://github.com/PowerShell/PowerShell/insights
https://github.com/PowerShell/PowerShell
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/11976
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/11976
Get-ConciseViewPositionMessage throws ArgumentOutOfRangeException in some caseshttps://github.com/PowerShell/PowerShell/issues/11976#top
https://github.com/SteveL-MSFT
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get ahttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Question%22
Resolution-FixedThe issue is fixed.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Fixed%22
WG-Enginecore PowerShell engine, interpreter, and runtimehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Engine%22
https://github.com/jpoehls
Joshua Poehls (jpoehls)https://github.com/jpoehls
on Feb 28, 2020https://github.com/PowerShell/PowerShell/issues/11976#issue-572931489
Joshua Poehls (jpoehls)https://github.com/jpoehls
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get ahttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Question%22
on Feb 28, 2020https://github.com/PowerShell/PowerShell/issues/11976#event-3083077555
https://github.com/jpoehls
Joshua Poehls (jpoehls)https://github.com/jpoehls
on Feb 28, 2020https://github.com/PowerShell/PowerShell/issues/11976#issuecomment-592666689
https://github.com/iSazonov
Ilya (iSazonov)https://github.com/iSazonov
on Feb 28, 2020https://github.com/PowerShell/PowerShell/issues/11976#issuecomment-592692968
#11941https://github.com/PowerShell/PowerShell/issues/11941
Steve Lee (@SteveL-MSFT)https://github.com/SteveL-MSFT
Ilya (iSazonov)https://github.com/iSazonov
WG-Enginecore PowerShell engine, interpreter, and runtimehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Engine%22
on Feb 28, 2020https://github.com/PowerShell/PowerShell/issues/11976#event-3083278305
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
on Feb 28, 2020https://github.com/PowerShell/PowerShell/issues/11976#event-3083310534
https://github.com/SteveL-MSFT
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
on Feb 28, 2020https://github.com/PowerShell/PowerShell/issues/11976#issuecomment-592717545
#11880https://github.com/PowerShell/PowerShell/pull/11880
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
Resolution-FixedThe issue is fixed.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Fixed%22
on Feb 28, 2020https://github.com/PowerShell/PowerShell/issues/11976#event-3083458706
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
completedhttps://github.com/PowerShell/PowerShell/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Feb 28, 2020https://github.com/PowerShell/PowerShell/issues/11976#event-3083458770
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PowerShell/issues/11976
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/11976
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get ahttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Question%22
Resolution-FixedThe issue is fixed.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Fixed%22
WG-Enginecore PowerShell engine, interpreter, and runtimehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Engine%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.