@@ -96,14 +96,14 @@ function Build-Module {
9696 # Folders which contain source .ps1 scripts to be concatenated into the module
9797 # Defaults to Enum, Classes, Private, Public
9898 [string []]$SourceDirectories = @ (
99- " Enum " , " Classes " , " Private " , " Public "
99+ " [Ee]num " , " [Cc]lasses " , " [Pp]rivate " , " [Pp]ublic "
100100 ),
101101
102102 # A Filter (relative to the module folder) for public functions
103103 # If non-empty, FunctionsToExport will be set with the file BaseNames of matching files
104104 # Defaults to Public\*.ps1
105105 [AllowEmptyString ()]
106- [string []]$PublicFilter = " Public\ *.ps1" ,
106+ [string []]$PublicFilter = " [Pp]ublic/ *.ps1" ,
107107
108108 # A switch that allows you to disable the update of the AliasesToExport
109109 # By default, (if PublicFilter is not empty, and this is not set)
@@ -206,8 +206,11 @@ function Build-Module {
206206
207207 # SilentlyContinue because there don't *HAVE* to be functions at all
208208 $AllScripts = @ ($ModuleInfo.SourceDirectories ).ForEach {
209- Get-ChildItem - Path (Join-Path - Path $ModuleInfo.ModuleBase - ChildPath $_ ) - Filter * .ps1 - Recurse - ErrorAction SilentlyContinue |
210- Sort-Object - Property ' FullName'
209+ # By explicitly converting, we support wildcards in the SourceDirectories parameter
210+ if ($SourceDirectory = Join-Path - Path $ModuleInfo.ModuleBase - ChildPath $_ | Convert-Path - ErrorAction SilentlyContinue) {
211+ Get-ChildItem - Path $SourceDirectory - Filter * .ps1 - Recurse - ErrorAction SilentlyContinue |
212+ Sort-Object - Property ' FullName'
213+ }
211214 }
212215
213216 # We have to force the Encoding to string because PowerShell Core made up encodings
0 commit comments