Title: Setting ExecutionPolicy LocalMachine Undefined results in corrupted json settings file · Issue #2346 · PowerShell/PowerShell · GitHub
Open Graph Title: Setting ExecutionPolicy LocalMachine Undefined results in corrupted json settings file · Issue #2346 · PowerShell/PowerShell
X Title: Setting ExecutionPolicy LocalMachine Undefined results in corrupted json settings file · Issue #2346 · PowerShell/PowerShell
Description: Steps to reproduce This is the second part of issue with #2342 There is a legitimate PS code that results in the corrupted JSON file PS C:\Users\sevoroby> Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy Undefined -Force PS C:\Us...
Open Graph Description: Steps to reproduce This is the second part of issue with #2342 There is a legitimate PS code that results in the corrupted JSON file PS C:\Users\sevoroby> Set-ExecutionPolicy -Scope LocalMachine -E...
X Description: Steps to reproduce This is the second part of issue with #2342 There is a legitimate PS code that results in the corrupted JSON file PS C:\Users\sevoroby> Set-ExecutionPolicy -Scope LocalMachine...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/2346
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Setting ExecutionPolicy LocalMachine Undefined results in corrupted json settings file","articleBody":"\u003c!--\n\nIf it is a bug report:\n- make sure you are able to repro it on the latest released version. \nYou can install the latest version from https://github.com/PowerShell/PowerShell/releases\n- Search the existing issues.\n- Refer to the [FAQ](../docs/FAQ.md).\n- Refer to the [known issues](../docs/KNOWNISSUES.md).\n- Fill out the following repro template\n\nIf it's not a bug, please remove the template and elaborate the issue in your own words.\n-->\n## Steps to reproduce\n\nThis is the second part of issue with #2342\n\nThere is a legitimate PS code that results in the corrupted JSON file\n\n```\nPS C:\\Users\\sevoroby> Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy Undefined -Force\nPS C:\\Users\\sevoroby> Get-ExecutionPolicy -List\n\n Scope ExecutionPolicy\n ----- ---------------\nMachinePolicy Undefined\n UserPolicy Undefined\n Process RemoteSigned\n CurrentUser RemoteSigned\nGet-ExecutionPolicy : Error reading JToken from JsonReader. Path '', line 0, position 0.\nAt line:1 char:1\n+ Get-ExecutionPolicy -List\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~\n + CategoryInfo : NotSpecified: (:) [Get-ExecutionPolicy], JsonReaderException\n + FullyQualifiedErrorId : Newtonsoft.Json.JsonReaderException,Microsoft.PowerShell.Commands.GetExecutionPolicyComm\n and\n```\n## Expected behavior\n\nNo error.\n## Actual behavior\n\nError from NewtonSoft.JSON\nIt also prevents PS from starting, due to #2342\n## Environment data\n\n\u003c!-- provide the output of $PSVersionTable -->\n\n``` powershell\n> $PSVersionTable\nName Value\n---- -----\nPSVersion 6.0.0-alpha\nCLRVersion\nGitCommitId v6.0.0-alpha.10\nPSRemotingProtocolVersion 2.3\nPSEdition Core\nSerializationVersion 1.1.0.1\nBuildVersion 3.0.0.0\nWSManStackVersion 3.0\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}\n```\n","author":{"url":"https://github.com/vors","@type":"Person","name":"vors"},"datePublished":"2016-09-22T22:19:33Z","url":"https://github.com/PowerShell/PowerShell/issues/2346"}
| 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:5c3e8a33-2420-2e44-681f-e37645b5cedf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F12:7EDFD:1232AF:194E96:6AFD6D14 |
| html-safe-nonce | f960ee5b8f0be03198cc07ecfd8550d679db0a3f76960c7db40e3e9da918c5ad |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjEyOjdFREZEOjEyMzJBRjoxOTRFOTY6NkFGRDZEMTQiLCJ2aXNpdG9yX2lkIjoiNzkyNzg3MjIwNTUyNDY1OTQ3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 573ace466887afff05f3feb6151e77b86f64feff474ab1fa57e111a6ff0e55b3 |
| hovercard-subject-tag | issue:178735423 |
| 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/2346/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e08a66ed88e36a60e565e2732661a2a7ab53d761993fa419c933cf85414f06a0/PowerShell/PowerShell/issues/2346 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e08a66ed88e36a60e565e2732661a2a7ab53d761993fa419c933cf85414f06a0/PowerShell/PowerShell/issues/2346 |
| og:image:alt | Steps to reproduce This is the second part of issue with #2342 There is a legitimate PS code that results in the corrupted JSON file PS C:\Users\sevoroby> Set-ExecutionPolicy -Scope LocalMachine -E... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vors |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9985ca2e21b59673104d4d830d4afeb946c67f248f273ab2e824c31c8db46e4a |
| 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 | 0db9e8d463c3f4540570e6ad3c501a06db9dc02a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width