Closed gaelcolas closed 1 year ago
Well, I think you could list each subfolder in SourceDirectories
in order, and it would work..
Currently, that code looks like:
Get-ChildItem -Path @($ModuleInfo.SourceDirectories).ForEach{ Join-Path $ModuleInfo.ModuleBase $_ } -Filter *.ps1 -Recurse -ErrorAction SilentlyContinue
I guess we could add | Sort-Object Fullname
and that would take care of it?
Draft PR coming in shortly... :)
The question will be, shall we mandate the sorting (as per your example), or leave the user to provide the -Property
to Sort-Object
...
Completed a while ago.
On Azure DevOps (ubuntu-latest MSFT hosted agents) the PowerShell lists the files in order but not the subfolders (at least not always). This creates psm1 that are unparseable for pwsh because the Class definition is not in order (inherited class defined before parent). This happens when
classes/
folder is further divided in subfolders (DSC Resources, GC Resources, Category1, Category2...).Question, can we have a "custom sorter"?