Title: The ParseError "The Try statement is missing its Catch or Finally block" works only one way. · Issue #25491 · PowerShell/PowerShell · GitHub
Open Graph Title: The ParseError "The Try statement is missing its Catch or Finally block" works only one way. · Issue #25491 · PowerShell/PowerShell
X Title: The ParseError "The Try statement is missing its Catch or Finally block" works only one way. · Issue #25491 · PowerShell/PowerShell
Description: A ParseError is generated if "The Try statement is missing its Catch or Finally block" works only one way." but not vice versa: if "The Catch or Finally statement is missing its Try block". See also: PowerShell/PSScriptAnalyzer#2098 Expe...
Open Graph Description: A ParseError is generated if "The Try statement is missing its Catch or Finally block" works only one way." but not vice versa: if "The Catch or Finally statement is missing its Try block". See als...
X Description: A ParseError is generated if "The Try statement is missing its Catch or Finally block" works only one way." but not vice versa: if "The Catch or Finally statement is missing its...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/25491
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The ParseError \"The Try statement is missing its Catch or Finally block\" works only one way.","articleBody":"A ParseError is generated if \"The Try statement is missing its Catch or Finally block\" works only one way.\" but not vice versa: if \"The Catch or Finally statement is missing its Try block\".\n\nSee also: https://github.com/PowerShell/PSScriptAnalyzer/issues/2098\n\n### Expected behavior\n\nA simular behavior for both situations, meaning:\nAn error when invokeing the following script:\n\n```PowerShell\nInvoke-ScriptAnalyzer -ScriptDefinition {function Test { Catch { write-verbose 'Test' } }}.ToString()\n```\n\nOr visa verse (no errors at alll), knowing that a standalone `Try` (e.g.: `$a = try { 1 / $b }`) makes more sense than a standalone `Catch`.\n\n### Actual behavior\n\nDifferent behavior on the symmetrical situation.\n\n### Environment data\n\n```powershell\nVersion 7.5.1\n```\n","author":{"url":"https://github.com/iRon7","@type":"Person","name":"iRon7"},"datePublished":"2025-05-01T07:22:44Z","url":"https://github.com/PowerShell/PowerShell/issues/25491"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:22689c9b-8b13-239a-bca8-9210ebb4c8cb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E468:3550D1:444C2B:5A1235:6AFCEA8E |
| html-safe-nonce | 7f53dd016d19c18ba112176e74b6d457cca083c89068ecaa8c4ef74cee913a11 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDY4OjM1NTBEMTo0NDRDMkI6NUExMjM1OjZBRkNFQThFIiwidmlzaXRvcl9pZCI6IjM5OTU1OTUwMzM0NDgwODIwNjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f63756a7dcfbbf77d148c0aa00148e8a0a8c1b8c0e87e58eebfe0ceedd31a4e1 |
| hovercard-subject-tag | issue:3033320836 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/25491/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6319086fb19141035519cacc7034e0881ae04ecbd15548364662cda3e00d6621/PowerShell/PowerShell/issues/25491 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6319086fb19141035519cacc7034e0881ae04ecbd15548364662cda3e00d6621/PowerShell/PowerShell/issues/25491 |
| og:image:alt | A ParseError is generated if "The Try statement is missing its Catch or Finally block" works only one way." but not vice versa: if "The Catch or Finally statement is missing its Try block". See als... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | iRon7 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 99aede4c5f55ec5cf06666a8c9e03ebf9f85f7231223e7f1c38c16e5504835b3 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ecfd63ca125ec74b42f74eeb158b3fa081c8c497 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width