mirror of
https://github.com/icsharpcode/ILSpy.git
synced 2026-10-12 02:15:58 +00:00
19 lines
655 B
PowerShell
19 lines
655 B
PowerShell
$ErrorActionPreference = "Stop";
|
|
|
|
[Reflection.Assembly]::LoadWithPartialName("System.Xml.Linq") | Out-Null
|
|
|
|
Write-Host "Sorting .resx files...";
|
|
|
|
Get-ChildItem -Include *.resx -Recurse | foreach ($_) {
|
|
Write-Host $_.FullName;
|
|
|
|
$doc = [System.Xml.Linq.XDocument]::Load($_.FullName);
|
|
$descendants = [System.Linq.Enumerable]::ToArray($doc.Descendants("data"));
|
|
|
|
[System.Xml.Linq.Extensions]::Remove($descendants);
|
|
$ordered = [System.Linq.Enumerable]::OrderBy($descendants, [System.Func[System.Xml.Linq.XElement,string]] { param ($e) $e.Attribute("name").Value }, [System.StringComparer]::Ordinal);
|
|
$doc.Root.Add($ordered);
|
|
$doc.Save($_.FullName);
|
|
}
|
|
|