Private/Show-SortedSidecar.ps1

function Show-SortedSidecar
{
    [CmdletBinding()]
    Param
    (
        [Parameter(Mandatory=$True)]
        [string]$SortedFile
    )

    BEGIN{}

    PROCESS
    {
        #The XML to be read and a standard element needed for the API call.
        $SortedXML = [xml](Get-Content $SortedFile)
        $DefaultRoutePartition = 'Internal_DN-PT'

        #Displaying directories on sidecar to the user:
        Write-Output "These are the current directories listed on the sidecar: "
        $CurrentDirsListed = $SortedXML.SelectNodes("//busyLampFields/busyLampField")
        $SortedDirs = $CurrentDirsListed | Sort-Object -Property label
        foreach($dir in $SortedDirs)
        {
            $dir.index + ":`t" + $dir.label
        }
    }
}