Title: Improve the configuration APIs in PSConfiguration.cs · Issue #5809 · PowerShell/PowerShell · GitHub
Open Graph Title: Improve the configuration APIs in PSConfiguration.cs · Issue #5809 · PowerShell/PowerShell
X Title: Improve the configuration APIs in PSConfiguration.cs · Issue #5809 · PowerShell/PowerShell
Description: The tasks that I can think of are: maybe replace the singleton with static methods schema check synchronize updating the configuration file from multiple processes. we currently have a read/write lock to protect updating/reading the conf...
Open Graph Description: The tasks that I can think of are: maybe replace the singleton with static methods schema check synchronize updating the configuration file from multiple processes. we currently have a read/write l...
X Description: The tasks that I can think of are: maybe replace the singleton with static methods schema check synchronize updating the configuration file from multiple processes. we currently have a read/write l...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/5809
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve the configuration APIs in PSConfiguration.cs","articleBody":"The tasks that I can think of are:\r\n1. maybe replace the singleton with static methods\r\n2. schema check\r\n3. synchronize updating the configuration file from multiple processes.\r\n - we currently have a read/write lock to protect updating/reading the config file. The lock doesn't help synchronize writing access from multiple processes.\r\n4. holding the config file in one process (e.g. `write` access or `none` share) will cause a new pwsh instance to crash at startup because it cannot access the config file and we don't deal with the `IOException`.\r\n - we could return default value when the config file is not accessible, but need to consider to not allow bypassing security settings because of that.\r\n - one option: have two sets of default values for security settings. One set is used when the config file doesn't exist or the security setting is not defined in the file; the other set is used when the file exists but not accessible, to enforce all security features that are configurable in the config file.\r\n\r\n#### Repro step for 4:\r\nFirst, run the following code to hold the config file of the current pwsh\r\n```\r\n$path = \"path-to-powershell.config.json\"\r\n$mode = \"Open\"\r\n$access = \"Read\"\r\n$share = \"None\"\r\n\r\n$file = [System.IO.File]::Open($path, $mode, $access, $share)\r\n```\r\nThen, start a new instance of the pwsh, and it will crash.","author":{"url":"https://github.com/daxian-dbw","@type":"Person","name":"daxian-dbw"},"datePublished":"2018-01-06T23:55:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/5809/PowerShell/issues/5809"}
| 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:669f8884-082b-ab51-6b0e-38ed24fe6d97 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9274:27265:CD54A9:118A6BD:6A57E93F |
| html-safe-nonce | c20f735fb17d3194882f14f7ada2729802b0b17dd7f79a19df2c27b818decd42 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Mjc0OjI3MjY1OkNENTRBOToxMThBNkJEOjZBNTdFOTNGIiwidmlzaXRvcl9pZCI6IjM1OTU2MTU3ODg3MDE1NzU0ODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 68a4dccbc90dd2b14669edf21b36a1893dfdf936d6e9a08de8175caede552d3c |
| hovercard-subject-tag | issue:286530400 |
| 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/5809/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d8431ae9ff953cbc6493b15feb7b5cc723d2c7bc7292b21f986f50d062765443/PowerShell/PowerShell/issues/5809 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d8431ae9ff953cbc6493b15feb7b5cc723d2c7bc7292b21f986f50d062765443/PowerShell/PowerShell/issues/5809 |
| og:image:alt | The tasks that I can think of are: maybe replace the singleton with static methods schema check synchronize updating the configuration file from multiple processes. we currently have a read/write l... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | daxian-dbw |
| hostname | github.com |
| expected-hostname | github.com |
| None | 49c8c15fabcbf356d607a90ca115c13b273e42ff8b74155de050fd229a9b0121 |
| 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 | 72a32c9d47294b6b7eb7f0250253277920c7a987 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width