{"id":18653836,"url":"https://github.com/powershellcrack/pssortjsonmodule","last_synced_at":"2025-08-17T10:04:45.139Z","repository":{"id":228245358,"uuid":"773477913","full_name":"PowerShellCrack/PSSortJsonModule","owner":"PowerShellCrack","description":"A simple module that will reorder a json keys in alphabetical order","archived":false,"fork":false,"pushed_at":"2024-07-12T23:05:09.000Z","size":42,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T20:21:27.199Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PowerShellCrack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-17T19:09:46.000Z","updated_at":"2024-07-12T23:05:12.000Z","dependencies_parsed_at":"2024-07-13T00:23:36.282Z","dependency_job_id":"7794e4bd-5407-4cea-bc0e-7a1a5c08ed28","html_url":"https://github.com/PowerShellCrack/PSSortJsonModule","commit_stats":null,"previous_names":["powershellcrack/pssortjsonmodule"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PowerShellCrack/PSSortJsonModule","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShellCrack%2FPSSortJsonModule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShellCrack%2FPSSortJsonModule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShellCrack%2FPSSortJsonModule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShellCrack%2FPSSortJsonModule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PowerShellCrack","download_url":"https://codeload.github.com/PowerShellCrack/PSSortJsonModule/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShellCrack%2FPSSortJsonModule/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270831894,"owners_count":24653429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T07:13:19.634Z","updated_at":"2025-08-17T10:04:45.115Z","avatar_url":"https://github.com/PowerShellCrack.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PSSortJsonModule\n\nA simple module that will reorder a json keys in alphabetical order\n\n## Install\n\n```powershell\nInstall-Module SortJson -Force\n```\n\n## Cmdlets\n\n- **Format-JsonOrder** : Primary caller\n- **ConvertTo-OrderObject** : Called when using _Format-JsonOrder_ but can be used separately\n- **Set-ObjectPropertyOrder** : Called when using _ConvertTo-OrderObject_ but can be used separately\n\n## Format-JsonOrder Parameters\n\n- **Json** : _Required_: [String or Object] The JSON text to sort.\n- **PropertyStartList** : _Optional_: [Array] The list of properties to put at the start of the json object.\n- **PropertyEndList** : _Optional_: [Array] The list of properties to put at the end of the json object.\n- **OnlyListedProperties** : _Optional_: [switch] Only list the properties that are in the PropertyStartList and PropertyEndList.\n- **SortAlphabetically** : _Optional_: [switch] Sort the properties alphabetically.\n- **IgnoreCaseSensitivity** : _Optional_: [switch] Ignore case sensitive ordering. Case Sensitivity is enabled by default\n- **Recursive** : _Optional_: [switch] Sort the properties that are arrays or objects.\n\n\u003e WARNING: Specifying lists  of properties that do not exist and the _-OnlyListedProperties_ parameter combined will return an empty json\n\n## Function Alias\n\nSort-Json\n\n## Parameter Alias\n\n|parameter|alias|\n|--|--|\n|**-PropertyStartList** | StartList, First|\n|**-PropertyEndList** | EndList, Last|\n|**-OnlyListedProperties** | OnlyListed|\n|**-SortAlphabetically** | Ascending|\n|**-IgnoreCaseSensitivity** | CaseInSensitive|\n|**-Recursive** | Recurse|\n\n## Example #1\n\n```powershell\n\n$json = @\"\n{\"displayName\":\"A test of json\",\"policyType\":\"BuiltIn\",\"mode\":\"Indexed\",\"description\":\"A test to see if the json get ordered\",\"metadata\":{\"version\":\"1.1.0\",\"category\":\"Ordering\"},\"parameters\":{\"effect\":{\"type\":\"String\",\"metadata\":\"@{displayName=Ordering; description=Order or not order that is the question}\",\"allowedValues\":\"Yes No\",\"defaultValue\":\"Yes\"}},\"policyRule\":{\"if\":{\"allOf\":\" \"},\"then\":{\"effect\":\"[parameters('order')]\"}},\"scopetag\":[\"order\",\"json\",\"default\",\"unorder\"]}\n\"@\n\n#Original JSON...\n$json | ConvertFrom-Json | ConvertTo-Json -Depth 100\n\n#Sorted JSON using pipeline...\n$json | Format-JsonOrder -SortAlphabetically -Recursive\n```\n\n## Example #2\n\n```powershell\n\n$json = @\"\n{\"displayName\":\"A test of json\",\"policyType\":\"BuiltIn\",\"mode\":\"Indexed\",\"description\":\"A test to see if the json get ordered\",\"metadata\":{\"version\":\"1.1.0\",\"category\":\"Ordering\"},\"parameters\":{\"effect\":{\"type\":\"String\",\"metadata\":\"@{displayName=Ordering; description=Order or not order that is the question}\",\"allowedValues\":\"Yes No\",\"defaultValue\":\"Yes\"}},\"policyRule\":{\"if\":{\"allOf\":\" \"},\"then\":{\"effect\":\"[parameters('order')]\"}},\"scopetag\":[\"order\",\"json\",\"default\",\"unorder\"]}\n\"@\n\n#Sorted JSON using Alias...\n$json | Sort-Json -First @('policyType','displayName') -Last @('policyRule') -Ascending -Recurse\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowershellcrack%2Fpssortjsonmodule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpowershellcrack%2Fpssortjsonmodule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowershellcrack%2Fpssortjsonmodule/lists"}