René's URL Explorer Experiment


Title: Add new MissingTryBlock rule by iRon7 · Pull Request #2179 · PowerShell/PSScriptAnalyzer · GitHub

Open Graph Title: Add new MissingTryBlock rule by iRon7 · Pull Request #2179 · PowerShell/PSScriptAnalyzer

X Title: Add new MissingTryBlock rule by iRon7 · Pull Request #2179 · PowerShell/PSScriptAnalyzer

Description: PR Summary Although #2098 didn't get an up-for-graps label, I did create the suggested Add new MissingTryBlock rule to warn when catch or finally blocks are not preceded by a try block because: I think that a catch block that misses a try block is less valid than a try block that misses a catch block which causes an parse error by the engine and therefore even deserves the severity Error A missing try block might easily get unnoticed during design time but will very likely fail during runtime It happened twice now that someone in our company tried to publish a script that was missing a try block Closes #1700 and Fixes #2098 PR Checklist PR has a meaningful title Use the present tense and imperative mood when describing your changes Summarized changes Change is not breaking Make sure all .cs, .ps1 and .psm1 files have the correct copyright header Make sure you've added a new test if existing tests do not effectively test the code changed and/or updated documentation This PR is ready to merge and is not Work in Progress. If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready.

Open Graph Description: PR Summary Although #2098 didn't get an up-for-graps label, I did create the suggested Add new MissingTryBlock rule to warn when catch or finally blocks are not preceded by a try block because...

X Description: PR Summary Although #2098 didn't get an up-for-graps label, I did create the suggested Add new MissingTryBlock rule to warn when catch or finally blocks are not preceded by a try block bec...

Opengraph URL: https://github.com/PowerShell/PSScriptAnalyzer/pull/2179

X: @github

direct link

Domain: github.com

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:6ef514c5-cf7b-9033-c0ae-ba512d18b0a3
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9B12:8A42B:258116:31CBB5:6AFD2589
html-safe-noncedbda49006a710c373d19dddebf112f794eb00ab05cbcf3be0b2fed9cc383baf3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjEyOjhBNDJCOjI1ODExNjozMUNCQjU6NkFGRDI1ODkiLCJ2aXNpdG9yX2lkIjoiMzM5MzIyMTE0MTQyNTEwNDI2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacfee07199c5318b236bdecf67d50463e80338623b42522823ff4fac0a0e8df2f5
hovercard-subject-tagpull_request:3568520393
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files
twitter:imagehttps://avatars.githubusercontent.com/u/8080834?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/8080834?s=400&v=4
og:image:altPR Summary Although #2098 didn't get an up-for-graps label, I did create the suggested Add new MissingTryBlock rule to warn when catch or finally blocks are not preceded by a try block because...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None065128366c233a9d57ff68ab6c96e25b99dd1b0ab70d23b70873d3dd6b5e4f19
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/PowerShell/PSScriptAnalyzer git https://github.com/PowerShell/PSScriptAnalyzer.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id33149177
octolytics-dimension-repository_nwoPowerShell/PSScriptAnalyzer
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id33149177
octolytics-dimension-repository_network_root_nwoPowerShell/PSScriptAnalyzer
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release941021edf0c2ec58298f4a2c8f27ae507d129c92
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPSScriptAnalyzer%2Fpull%2F2179%2Ffiles
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%2FPSScriptAnalyzer%2Fpull%2F2179%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=PowerShell%2FPSScriptAnalyzer
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files
PowerShellhttps://github.com/PowerShell
PSScriptAnalyzerhttps://github.com/PowerShell/PSScriptAnalyzer
Codehttps://github.com/PowerShell/PSScriptAnalyzer
Issues407 (407)https://github.com/PowerShell/PSScriptAnalyzer/issues
Pull requests34 (34)https://github.com/PowerShell/PSScriptAnalyzer/pulls
Discussionshttps://github.com/PowerShell/PSScriptAnalyzer/discussions
Actionshttps://github.com/PowerShell/PSScriptAnalyzer/actions
Projectshttps://github.com/PowerShell/PSScriptAnalyzer/projects
Wikihttps://github.com/PowerShell/PSScriptAnalyzer/wiki
Security and qualityhttps://github.com/PowerShell/PSScriptAnalyzer/security
Insightshttps://github.com/PowerShell/PSScriptAnalyzer/insights
Sign up for GitHub https://github.com/signup?return_to=%2FPowerShell%2FPSScriptAnalyzer%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FPowerShell%2FPSScriptAnalyzer%2Fissues%2Fnew%2Fchoose
Andy Jordan (andyleejordan)https://github.com/andyleejordan
PowerShell:mainhttps://github.com/PowerShell/PSScriptAnalyzer/tree/main
iRon7:#2098MissingTryBlockhttps://github.com/iRon7/PSScriptAnalyzer/tree/%232098MissingTryBlock
Conversation 25 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179
Commits 16 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits
Checks 4 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/checks
Files changed https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files
Add new MissingTryBlock rule https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files#top
Show all changes 16 commits https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files
1da47c4 #2098 Add new MissingTryBlock rule iRon7 Apr 22, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits/1da47c4204d73f1c22904d5a5426b3b3e351d6cd
e9a2365 Changed severity level of MissingTryBlock rule from Error to Warning … iRon7 Apr 29, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits/e9a23659092dd342ac9f13df050a519ce9681fce
50f751f Updated tests for MissingTryBlock rule to reflect severity change fro… iRon7 Apr 29, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits/50f751fd1577f30e7abcd4f309fd1b5f42e67e3c
79e80aa Update Rules/MissingTryBlock.cs iRon7 Apr 29, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits/79e80aa4ce93a553714e431a98baac4bb9e26a7b
47507bb Grammar: “which is likely a mistake and result in … error” is ungramm… iRon7 Apr 29, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits/47507bbc695525bf238b7e174e71727258daaeac
449fdd1 Merge branch '#2098MissingTryBlock' of https://github.com/iRon7/PSScr… iRon7 Apr 29, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits/449fdd109752e226e9bf657ece3798c36c038263
e1a8d3f Update Rules/Strings.resx iRon7 Apr 29, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits/e1a8d3f5ba6ef404f9993b21961a893c198a07f2
a420820 Update Rules/MissingTryBlock.cs iRon7 Apr 29, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits/a42082080af70731afc9286ce3c6f8c16aea9899
216645d minor but worthwhile iRon7 Apr 29, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits/216645d8f716a858e3fd293a91690d222a997042
f53cc38 Update docs/Rules/MissingTryBlock.md iRon7 May 7, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits/f53cc38d58477ba72cfdbb021d8b1f9083e56145
7c22919 Merge branch '#2098MissingTryBlock' of https://github.com/iRon7/PSScr… iRon7 May 12, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits/7c22919b499e25b6272869354e6d51171fc6bc37
4b94c24 Applied feedback from @andrewconnell to add a note about the rule not… iRon7 May 12, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits/4b94c24aad25e20d63f0a117eb022f30075c1318
52598a1 Update docs/Rules/MissingTryBlock.md iRon7 May 15, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits/52598a18046843e68cb457b2f6a602f71f3f150b
9dc55e2 Update Tests/Rules/MissingTryBlock.tests.ps1 iRon7 May 15, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits/9dc55e2f612bb37924ec7a1f1465565e98f4db85
cee9c87 Update Rules/MissingTryBlock.cs iRon7 May 15, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits/cee9c876608fee44871a3fc9bc557d9e8a24efb7
48ab58a Update Rules/MissingTryBlock.cs iRon7 May 15, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/commits/48ab58a82518a838fffca6651fa16b51ab26be35
Clear filters https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files
MissingTryBlock.cs https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files#diff-2876863764cb46be2459fbfa9ed8c288311e581234cf7ff1f6441069cc479127
Strings.resx https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files#diff-dcff94e6a5c5ee1dc9226dea0752aba08f8f1f53020b4a0e67f1ac944036b8c3
MissingTryBlock.tests.ps1 https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files#diff-bb0c19e57fc38e9e508c8796d566759ab6e69417f512f34b378bcbd3ea16eea7
MissingTryBlock.md https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files#diff-c550c673ceaa20e35b51c48d6a96a4897c87e98d0dba8e96ae19890d9f71b5fa
README.md https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files#diff-aa3ee3522a3ec73c6f36f2fe020f02ee8517299d57cfe67d99ff0efd2038a0d5
https://github.com/PowerShell/PSScriptAnalyzer/blob/main/.github/CODEOWNERS#L2
Rules/MissingTryBlock.cshttps://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files#diff-2876863764cb46be2459fbfa9ed8c288311e581234cf7ff1f6441069cc479127
View file https://github.com/iRon7/PSScriptAnalyzer/blob/48ab58a82518a838fffca6651fa16b51ab26be35/Rules/MissingTryBlock.cs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/{{ revealButtonHref }}
https://github.com/PowerShell/PSScriptAnalyzer/blob/main/.github/CODEOWNERS#L2
Rules/Strings.resxhttps://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files#diff-dcff94e6a5c5ee1dc9226dea0752aba08f8f1f53020b4a0e67f1ac944036b8c3
View file https://github.com/iRon7/PSScriptAnalyzer/blob/48ab58a82518a838fffca6651fa16b51ab26be35/Rules/Strings.resx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/{{ revealButtonHref }}
https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files#diff-dcff94e6a5c5ee1dc9226dea0752aba08f8f1f53020b4a0e67f1ac944036b8c3
https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files#diff-dcff94e6a5c5ee1dc9226dea0752aba08f8f1f53020b4a0e67f1ac944036b8c3
https://github.com/PowerShell/PSScriptAnalyzer/blob/main/.github/CODEOWNERS#L2
Tests/Rules/MissingTryBlock.tests.ps1https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files#diff-bb0c19e57fc38e9e508c8796d566759ab6e69417f512f34b378bcbd3ea16eea7
View file https://github.com/iRon7/PSScriptAnalyzer/blob/48ab58a82518a838fffca6651fa16b51ab26be35/Tests/Rules/MissingTryBlock.tests.ps1
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/{{ revealButtonHref }}
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files
https://github.com/PowerShell/PSScriptAnalyzer/blob/main/.github/CODEOWNERS#L6
docs/Rules/MissingTryBlock.mdhttps://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files#diff-c550c673ceaa20e35b51c48d6a96a4897c87e98d0dba8e96ae19890d9f71b5fa
View file https://github.com/iRon7/PSScriptAnalyzer/blob/48ab58a82518a838fffca6651fa16b51ab26be35/docs/Rules/MissingTryBlock.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/{{ revealButtonHref }}
https://github.com/PowerShell/PSScriptAnalyzer/blob/main/.github/CODEOWNERS#L6
docs/Rules/README.mdhttps://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files#diff-aa3ee3522a3ec73c6f36f2fe020f02ee8517299d57cfe67d99ff0efd2038a0d5
View file https://github.com/iRon7/PSScriptAnalyzer/blob/48ab58a82518a838fffca6651fa16b51ab26be35/docs/Rules/README.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/{{ revealButtonHref }}
https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files#diff-aa3ee3522a3ec73c6f36f2fe020f02ee8517299d57cfe67d99ff0efd2038a0d5
https://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files#diff-aa3ee3522a3ec73c6f36f2fe020f02ee8517299d57cfe67d99ff0efd2038a0d5
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2179/files
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.