CUCMSidecarWorkflow/Private/Show-SortedSidecar.ps1

function Show-SortedSidecar {
 <#
    .SYNOPSIS
     Shows the directories on the sidecar in alphabetical order.
 
     .DESCRIPTION
     Show-SortedSidecar takes the Sorted.xml file, and displays the content on the screen for the user.
 
     .PARAMETER SortedFile
     The XML document which holds the infomation of the sorted directories.
 
    #>

    [CmdletBinding()]
    Param
    (
        [Parameter(Mandatory= $true)] $SortedFile 
    )
    BEGIN{}

    PROCESS
    {   
        $SortedFile = "C:\users\$env:USERNAME\Desktop\Sorted.xml"
        $SortedDoc = [xml](Get-Content $SortedFile)
        Write-Output "These are the current directories listed on the sidecar: "

        $CurrentDirs = $SortedDoc.SelectNodes("//busyLampFields/busyLampField")
        $SortedDirs = $CurrentDirs | Sort-Object -Property label
        foreach($dir in $SortedDirs)
        {
            $dir.index + ":`t" + $dir.label
        }
    }
    END{}
}