Skip to content

Instantly share code, notes, and snippets.

@mavaddat
Created January 19, 2023 13:35
Show Gist options
  • Save mavaddat/4c193081194e4beb980f521b060a05a8 to your computer and use it in GitHub Desktop.
Save mavaddat/4c193081194e4beb980f521b060a05a8 to your computer and use it in GitHub Desktop.
A script to sort the VS Code settings JSON file by key.
Get-Content -Path "$env:APPDATA\Code - Insiders\User\settings.json" | ConvertFrom-Json -AsHashtable | ForEach-Object { $sortedSettings = [System.Collections.Generic.SortedDictionary[string,pscustomobject]]::new(); ($vsCodeSettings = $_) | Write-Output } | Select-Object -ExpandProperty Keys | ForEach-Object { $sortedSettings.Add($_,$vsCodeSettings[$_] )}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment