<!-- If it is a bug report: - make sure you are able to repro it on the latest released version. You can install the latest version from https://github.com/PowerShell/PowerShell/releases - Search the existing issues. - Refer to the [FAQ](../docs/FAQ.md). - Refer to the [known issues](../docs/KNOWNISSUES.md). - Fill out the following repro template If it's not a bug, please remove the template and elaborate the issue in your own words. --> ## 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:\Users\sevoroby> Get-ExecutionPolicy -List Scope ExecutionPolicy ----- --------------- MachinePolicy Undefined UserPolicy Undefined Process RemoteSigned CurrentUser RemoteSigned Get-ExecutionPolicy : Error reading JToken from JsonReader. Path '', line 0, position 0. At line:1 char:1 + Get-ExecutionPolicy -List + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-ExecutionPolicy], JsonReaderException + FullyQualifiedErrorId : Newtonsoft.Json.JsonReaderException,Microsoft.PowerShell.Commands.GetExecutionPolicyComm and ``` ## Expected behavior No error. ## Actual behavior Error from NewtonSoft.JSON It also prevents PS from starting, due to #2342 ## Environment data <!-- provide the output of $PSVersionTable --> ``` powershell > $PSVersionTable Name Value ---- ----- PSVersion 6.0.0-alpha CLRVersion GitCommitId v6.0.0-alpha.10 PSRemotingProtocolVersion 2.3 PSEdition Core SerializationVersion 1.1.0.1 BuildVersion 3.0.0.0 WSManStackVersion 3.0 PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} ```
Activity
daxian-dbw commentedon Sep 22, 2016
cc Mike Richmond (@mirichmo)
mirichmo commentedon Sep 27, 2016
The simplest repro is to empty the config file:
and then restart PowerShell.