<commit_before>using System;
using System.IO;
using System.Management.Automation;
using Microsoft.PowerShell.CrossCompatibility.Data;
using Microsoft.PowerShell.CrossCompatibility.Utility;
using Newtonsoft.Json;

namespace Microsoft.PowerShell.CrossCompatibility.Commands
{
    [Cmdlet(VerbsData.ConvertTo, CommandUtilities.MODULE_PREFIX + "Json")]
    public class ConvertToPSCompatibilityJsonCommand : PSCmdlet
    {
        private JsonProfileSerializer _serializer;

        [Parameter(Mandatory = true, ValueFromPipeline = true)]
        public object Item { get; set; }

        [Parameter]
        [Alias(new [] { "Compress" })]
        public SwitchParameter NoWhitespace { get; set; }

        protected override void BeginProcessing()
        {
            _serializer = JsonProfileSerializer.Create(NoWhitespace ? Formatting.None : Formatting.Indented);
        }

        protected override void ProcessRecord()
        {
            WriteObject(_serializer.Serialize(Item));
            return;
        }
    }

    [Cmdlet(VerbsData.ConvertFrom, CommandUtilities.MODULE_PREFIX + "Json")]
    public class ConvertFromPSCompatibilityJsonCommand : PSCmdlet
    {
        private JsonProfileSerializer _serializer;

        [Parameter(Mandatory = true, ValueFromPipeline = true, ParameterSetName = "JsonSource")]
        public object[] JsonSource { get; set; }

        [Parameter(Mandatory = true, ParameterSetName = "Path")]
        [ValidateNotNullOrEmpty()]
        public string[] Path { get; set; }

        public ConvertFromPSCompatibilityJsonCommand()
        {
            _serializer = JsonProfileSerializer.Create();
        }

        protected override void ProcessRecord()
        {
            if (Path != null)
            {<commit_msg>Fix enumeration in json cmdlet<commit_after>using System;
using System.IO;
using System.Management.Automation;
using Microsoft.PowerShell.CrossCompatibility.Data;
using Microsoft.PowerShell.CrossCompatibility.Utility;
using Newtonsoft.Json;

namespace Microsoft.PowerShell.CrossCompatibility.Commands
{
    [Cmdlet(VerbsData.ConvertTo, CommandUtilities.MODULE_PREFIX + "Json")]
    public class ConvertToPSCompatibilityJsonCommand : PSCmdlet
    {
        private JsonProfileSerializer _serializer;

        [Parameter(Mandatory = true, ValueFromPipeline = true)]
        public object[] Item { get; set; }

        [Parameter]
        [Alias(new [] { "Compress" })]
        public SwitchParameter NoWhitespace { get; set; }

        protected override void BeginProcessing()
        {
            _serializer = JsonProfileSerializer.Create(NoWhitespace ? Formatting.None : Formatting.Indented);
        }

        protected override void ProcessRecord()
        {
            foreach (object obj in Item)
            {
                WriteObject(_serializer.Serialize(obj));
            }
            return;
        }
    }

    [Cmdlet(VerbsData.ConvertFrom, CommandUtilities.MODULE_PREFIX + "Json")]
    public class ConvertFromPSCompatibilityJsonCommand : PSCmdlet
    {
        private JsonProfileSerializer _serializer;

        [Parameter(Mandatory = true, ValueFromPipeline = true, ParameterSetName = "JsonSource")]
        public object[] JsonSource { get; set; }

        [Parameter(Mandatory = true, ParameterSetName = "Path")]
        [ValidateNotNullOrEmpty()]
        public string[] Path { get; set; }

        public ConvertFromPSCompatibilityJsonCommand()
        {
            _serializer = JsonProfileSerializer.Create();
        }

        protected override void ProcessRecord()
        {
            if (Path != null)
            {
{'fraction_non_alphanumeric': 0.08676429953025698, 'fraction_numerical': 0.0, 'mean_word_length': 2.7945492662473796, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1121492', 'n_tokens_mistral': 926, 'n_tokens_neox': 919, 'n_words': 203}