Title: Missing try{} block not reported as a problem · Issue #1700 · PowerShell/PSScriptAnalyzer · GitHub
Open Graph Title: Missing try{} block not reported as a problem · Issue #1700 · PowerShell/PSScriptAnalyzer
X Title: Missing try{} block not reported as a problem · Issue #1700 · PowerShell/PSScriptAnalyzer
Description: Steps to reproduce Write-Output "Test" catch { Continue } save it as a file, then run Invoke-ScriptAnalyzer against it. Expected behavior An error should be displayed, saying that there's no 'try' block, just 'catch'. Actual behavior No ...
Open Graph Description: Steps to reproduce Write-Output "Test" catch { Continue } save it as a file, then run Invoke-ScriptAnalyzer against it. Expected behavior An error should be displayed, saying that there's no 'try' ...
X Description: Steps to reproduce Write-Output "Test" catch { Continue } save it as a file, then run Invoke-ScriptAnalyzer against it. Expected behavior An error should be displayed, saying that there...
Opengraph URL: https://github.com/PowerShell/PSScriptAnalyzer/issues/1700
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Missing try{} block not reported as a problem","articleBody":"Steps to reproduce\r\n------------------\r\n\r\n```PowerShell\r\nWrite-Output \"Test\"\r\ncatch {\r\n Continue\r\n}\r\n```\r\n\r\nsave it as a file, then run Invoke-ScriptAnalyzer against it.\r\n\r\nExpected behavior\r\n-----------------\r\n\r\nAn error should be displayed, saying that there's no 'try' block, just 'catch'.\r\n\r\nActual behavior\r\n---------------\r\n\r\nNo error is returned and the script throws an error when executed.\r\n```Powershell\r\ncatch : The term 'catch' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a p\r\n again.\r\nAt C:\\Users\\mchojnac\\Desktop\\test.ps1:2 char:1\r\n+ catch {\r\n+ ~~~~~\r\n + CategoryInfo : ObjectNotFound: (catch:String) [], CommandNotFoundException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n\r\n\u003c!-- Provide the output of the following 2 commands -->\r\n\r\n```PowerShell\r\n> $PSVersionTable\r\n\r\nName Value\r\n---- -----\r\nPSVersion 5.1.19041.1023\r\nPSEdition Desktop\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}\r\nBuildVersion 10.0.19041.1023\r\nCLRVersion 4.0.30319.42000\r\nWSManStackVersion 3.0\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\n\r\n> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }\r\n1.19.1\r\n```\r\n","author":{"url":"https://github.com/bytepl","@type":"Person","name":"bytepl"},"datePublished":"2021-07-22T10:45:34Z","url":"https://github.com/PowerShell/PSScriptAnalyzer/issues/1700"}
| 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:4a8201ef-6c9d-b5c5-e6aa-981c83f5bf30 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ED3C:19BDBF:2F4DD1:3E914B:6AFCE483 |
| html-safe-nonce | 2a67f768a413ed316d2fd06f3607cb6a1e7561076cef272243b967c29ce486fb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDNDOjE5QkRCRjoyRjRERDE6M0U5MTRCOjZBRkNFNDgzIiwidmlzaXRvcl9pZCI6Ijg1NDMxNDY2NzE3NzEyODA1MTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b89376b041bc43a07b606c5dc104c46dcd83690735c23daaae711e159076d712 |
| hovercard-subject-tag | issue:950527964 |
| 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/PSScriptAnalyzer/1700/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2756253c8cdda0a9ca20610ef45462353cbf3a1ca851b65190fe6da1cd9d9ae0/PowerShell/PSScriptAnalyzer/issues/1700 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2756253c8cdda0a9ca20610ef45462353cbf3a1ca851b65190fe6da1cd9d9ae0/PowerShell/PSScriptAnalyzer/issues/1700 |
| og:image:alt | Steps to reproduce Write-Output "Test" catch { Continue } save it as a file, then run Invoke-ScriptAnalyzer against it. Expected behavior An error should be displayed, saying that there's no 'try' ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bytepl |
| hostname | github.com |
| expected-hostname | github.com |
| None | 99aede4c5f55ec5cf06666a8c9e03ebf9f85f7231223e7f1c38c16e5504835b3 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PSScriptAnalyzer git https://github.com/PowerShell/PSScriptAnalyzer.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 33149177 |
| octolytics-dimension-repository_nwo | PowerShell/PSScriptAnalyzer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 33149177 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PSScriptAnalyzer |
| 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