Title: Set-StrictMode should cause errors to terminate execution. · Issue #9591 · PowerShell/PowerShell · GitHub
Open Graph Title: Set-StrictMode should cause errors to terminate execution. · Issue #9591 · PowerShell/PowerShell
X Title: Set-StrictMode should cause errors to terminate execution. · Issue #9591 · PowerShell/PowerShell
Description: Set-StrictMode should cause errors to terminate execution. In most languages with exceptions, an unhandled exception causes the program to terminate. However, Powershell defaults to continuing on when an unhandled exception occurs. As a ...
Open Graph Description: Set-StrictMode should cause errors to terminate execution. In most languages with exceptions, an unhandled exception causes the program to terminate. However, Powershell defaults to continuing on w...
X Description: Set-StrictMode should cause errors to terminate execution. In most languages with exceptions, an unhandled exception causes the program to terminate. However, Powershell defaults to continuing on w...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/9591
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Set-StrictMode should cause errors to terminate execution.","articleBody":"# Set-StrictMode should cause errors to terminate execution.\r\n\r\nIn most languages with exceptions, an unhandled exception causes the program to terminate. However, Powershell defaults to continuing on when an unhandled exception occurs.\r\n\r\nAs a result, I think it is currently widely considered a best practice to begin all scripts with:\r\n\r\n```\r\n$ErrorActionPreference = \"Stop\"\r\nSet-StrictMode -Version 3.0\r\n```\r\n\r\n# Proposed change\r\n\r\nThis should be equivalent to the above:\r\n```\r\nSet-StrictMode -Version 4.0 \r\n```\r\n\r\nThere is also some discussion in https://github.com/PowerShell/PowerShell-RFC/pull/88 .\r\nI think that whatever the mechanism for causing non-zero exit codes to halt execution, that should also be included in StrictMode.","author":{"url":"https://github.com/lukeschlather","@type":"Person","name":"lukeschlather"},"datePublished":"2019-05-13T20:09:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/9591/PowerShell/issues/9591"}
| 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:6f24ebc8-c257-5159-0e72-f95c7f2358e4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9BBC:1A070E:9A25C6B:CB444CE:696E043F |
| html-safe-nonce | 87e58619526b79518e0561aec4e9d51a3d98756379c7cd53ab238bb6d32606c0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QkJDOjFBMDcwRTo5QTI1QzZCOkNCNDQ0Q0U6Njk2RTA0M0YiLCJ2aXNpdG9yX2lkIjoiMTcyMzA2NjkzNDQ3MjA4MjQ5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d216cbe96faff36edd09c5092ca88bc18418888e2010867ddcde2b69ef3ebfdf |
| hovercard-subject-tag | issue:443578814 |
| 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/9591/issue_layout |
| twitter:image | https://opengraph.githubassets.com/80004af3152e57d4d6bdfdf861a6c0196f80e9a00e470d471e497bbe6ba8f3cf/PowerShell/PowerShell/issues/9591 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/80004af3152e57d4d6bdfdf861a6c0196f80e9a00e470d471e497bbe6ba8f3cf/PowerShell/PowerShell/issues/9591 |
| og:image:alt | Set-StrictMode should cause errors to terminate execution. In most languages with exceptions, an unhandled exception causes the program to terminate. However, Powershell defaults to continuing on w... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lukeschlather |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9b5131b207ddd175abf059a848d5f4302ec0606b02211b989013be49cf08593e |
| 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 | f8590a63bfc8093b241930ca57d536c9a50f9680 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width