Replies: 1 comment
-
Here's some code which will restore the sort order of RootComponents that existed before pac 1.20. This seems to be working OK for me but use with caution. Function SortRootComponents() {
# TEMPORARY: Since pac 1.20 a change was made to export <RootComponent> by type in alpha order, rather
# than numerically by the type attribute. This reverts the sorting to be numeric
$solnxml = Join-Path $solutionfolder "Other"
$solnxml = Join-Path $solnxml "Solution.xml"
[xml]$xmlDoc = Get-Content $solnxml
$rootComponents = $xmlDoc.ImportExportXml.SolutionManifest.RootComponents
# Guard against an empty rootComponents element
if ($rootComponents -ne "") {
Write-Host "Reordering RootComponents in " $solnxml
# Sort the RootComponents
$orderedRootComponents = $rootComponents.RootComponent | Sort-Object { [int]$_.type }, schemaName, id
# Remove existing RootComponents elements.
# Assumes that only RootComponent elements exist below the parent RootComponents element
$rootComponents.RemoveAll()
# Append sorted RootComponent elements
$orderedRootComponents | ForEach-Object { $rootComponents.AppendChild($_) } | Out-Null
# Save the update solution.xml file
$xmlDoc.Save($solnxml)
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thank you for working on getting the solution.xml to export consistently.
On pac 1.20 the sorting of the
RootComponent
attribute in solution.xml was changed to sort alphabetically by type, rather than numerically as was done in previous versions. Sorting numerically seemed better. Small nit, but worth logging.Beta Was this translation helpful? Give feedback.
All reactions