diff --git a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs
index 46ba23bbc0e..7b3c5127824 100644
--- a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs
+++ b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs
@@ -7356,6 +7356,13 @@ private static void ImportFunctions(FunctionInfo func, SessionStateInternal targ
message = StringUtil.Format(Modules.ImportingFunction, prefixedName);
cmdlet.WriteVerbose(message);
}
+ else
+ {
+ string manifestFilename = Path.GetFileName(cmdlet.Context.PreviousModuleProcessed);
+ string moduleFilename = Path.GetFileName(sourceModule.Path);
+ message = StringUtil.Format(Modules.NotImportingFunction, func.Name, moduleFilename, manifestFilename);
+ cmdlet.WriteVerbose(message);
+ }
}
private static void SetCommandVisibility(bool isImportModulePrivate, CommandInfo command)
diff --git a/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs b/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs
index 73baaf94f8b..49d257fe085 100644
--- a/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs
+++ b/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs
@@ -1566,7 +1566,8 @@ internal static void ExportModuleMembers(
if (SessionStateUtilities.MatchesAnyWildcardPattern(entry.Key, functionPatterns, false))
{
sessionState.ExportedFunctions.Add(entry.Value);
- string message = StringUtil.Format(Modules.ExportingFunction, entry.Key);
+ string filename = Path.GetFileName(sessionState.Module.Path);
+ string message = StringUtil.Format(Modules.ExportingFunction, entry.Key, filename);
cmdlet.WriteVerbose(message);
}
}
diff --git a/src/System.Management.Automation/resources/Modules.resx b/src/System.Management.Automation/resources/Modules.resx
index 477600724ff..4e54450986f 100644
--- a/src/System.Management.Automation/resources/Modules.resx
+++ b/src/System.Management.Automation/resources/Modules.resx
@@ -294,6 +294,9 @@
Importing function '{0}'.
+
+ Not exporting function '{0}' from '{1}' via '{2}'.
+
Importing cmdlet '{0}'.
@@ -307,7 +310,7 @@
Exporting cmdlet '{0}'.
- Exporting function '{0}'.
+ Exporting function '{0}' from '{1}'.
Exporting alias '{0}'.