File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -210,10 +210,14 @@ function Build-Module {
210210 # We have to force the Encoding to string because PowerShell Core made up encodings
211211 SetModuleContent - Source (@ ($ModuleInfo.Prefix ) + $AllScripts.FullName + @ ($ModuleInfo.Suffix )).Where {$_ } - Output $RootModule - Encoding " $ ( $ModuleInfo.Encoding ) "
212212
213+ if (-not $ModuleInfo.IgnoreAlias ) {
214+ $AliasesToExport = $ParseResult | GetCommandAlias
215+ }
216+
213217 # If there is a PublicFilter, update ExportedFunctions
214218 if ($ModuleInfo.PublicFilter ) {
215219 # SilentlyContinue because there don't *HAVE* to be public functions
216- if (($PublicFunctions = Get-ChildItem $ModuleInfo.PublicFilter - Recurse - ErrorAction SilentlyContinue | Where-Object BaseName -in $AllScripts.BaseName | Select-Object - ExpandProperty BaseName)) {
220+ if (($PublicFunctions = Get-ChildItem $ModuleInfo.PublicFilter - Recurse - ErrorAction SilentlyContinue | Where-Object { $_ . BaseName -in $AllScripts.BaseName -and $_ .BaseName -notin $AliasesToExport } | Select-Object - ExpandProperty BaseName)) {
217221 Update-Metadata - Path $OutputManifest - PropertyName FunctionsToExport - Value $PublicFunctions
218222 }
219223 }
@@ -222,7 +226,7 @@ function Build-Module {
222226 $ParseResult | MoveUsingStatements - Encoding " $ ( $ModuleInfo.Encoding ) "
223227
224228 if ($PublicFunctions -and -not $ModuleInfo.IgnoreAlias ) {
225- if (($AliasesToExport = ( $ParseResult | GetCommandAlias) [$PublicFunctions ] | ForEach-Object { $_ } | Select-Object - Unique)) {
229+ if (($AliasesToExport = $AliasesToExport [$PublicFunctions ] | ForEach-Object { $_ } | Select-Object - Unique)) {
226230 Update-Metadata - Path $OutputManifest - PropertyName AliasesToExport - Value $AliasesToExport
227231 }
228232 }
You can’t perform that action at this time.
0 commit comments