Skip to content

Commit 9470aa6

Browse files
authored
Merge pull request #120 from gaelcolas/fix/#118b
fixing #118 by mandating sort by FullName
2 parents 241b01e + b84f9be commit 9470aa6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Source/Public/Build-Module.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@ function Build-Module {
205205
Write-Verbose "Combine scripts to $RootModule"
206206

207207
# SilentlyContinue because there don't *HAVE* to be functions at all
208-
$AllScripts = Get-ChildItem -Path @($ModuleInfo.SourceDirectories).ForEach{ Join-Path $ModuleInfo.ModuleBase $_ } -Filter *.ps1 -Recurse -ErrorAction SilentlyContinue
208+
$AllScripts = @($ModuleInfo.SourceDirectories).ForEach{
209+
Get-ChildItem -Path (Join-Path -Path $ModuleInfo.ModuleBase -ChildPath $_) -Filter *.ps1 -Recurse -ErrorAction SilentlyContinue |
210+
Sort-Object -Property 'FullName'
211+
}
209212

210213
# We have to force the Encoding to string because PowerShell Core made up encodings
211214
SetModuleContent -Source (@($ModuleInfo.Prefix) + $AllScripts.FullName + @($ModuleInfo.Suffix)).Where{$_} -Output $RootModule -Encoding "$($ModuleInfo.Encoding)"

0 commit comments

Comments
 (0)