File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -210,10 +210,14 @@ function Build-Module {
210
210
# We have to force the Encoding to string because PowerShell Core made up encodings
211
211
SetModuleContent - Source (@ ($ModuleInfo.Prefix ) + $AllScripts.FullName + @ ($ModuleInfo.Suffix )).Where {$_ } - Output $RootModule - Encoding " $ ( $ModuleInfo.Encoding ) "
212
212
213
+ if (-not $ModuleInfo.IgnoreAlias ) {
214
+ $AliasesToExport = $ParseResult | GetCommandAlias
215
+ }
216
+
213
217
# If there is a PublicFilter, update ExportedFunctions
214
218
if ($ModuleInfo.PublicFilter ) {
215
219
# 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)) {
217
221
Update-Metadata - Path $OutputManifest - PropertyName FunctionsToExport - Value $PublicFunctions
218
222
}
219
223
}
@@ -222,7 +226,7 @@ function Build-Module {
222
226
$ParseResult | MoveUsingStatements - Encoding " $ ( $ModuleInfo.Encoding ) "
223
227
224
228
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)) {
226
230
Update-Metadata - Path $OutputManifest - PropertyName AliasesToExport - Value $AliasesToExport
227
231
}
228
232
}
You can’t perform that action at this time.
0 commit comments