Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,11 @@ private PSModuleInfo ImportModule_LocallyViaName(ImportModuleOptions importModul
else if (Directory.Exists(rootedPath))
{
// Load the latest valid version if it is a multi-version module directory
foundModule = LoadUsingMultiVersionModuleBase(rootedPath, importModuleOptions, out found);
foundModule = LoadUsingMultiVersionModuleBase(rootedPath,
ManifestProcessingFlags.LoadElements |
ManifestProcessingFlags.WriteErrors |
ManifestProcessingFlags.NullOnFirstError,
importModuleOptions, out found);

if (!found)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ internal bool LoadUsingModulePath(PSModuleInfo parentModule, bool found, IEnumer
string qualifiedPath = Path.Combine(path, fileBaseName);

// Load the latest valid version if it is a multi-version module directory
module = LoadUsingMultiVersionModuleBase(qualifiedPath, options, out found);
module = LoadUsingMultiVersionModuleBase(qualifiedPath, manifestProcessingFlags, options, out found);

if (!found)
{
Expand Down Expand Up @@ -432,10 +432,11 @@ internal bool LoadUsingModulePath(PSModuleInfo parentModule, bool found, IEnumer
/// Loads the latest valid version if moduleBase is a multi-versioned module directory
/// </summary>
/// <param name="moduleBase">module directory path</param>
/// <param name="manifestProcessingFlags">The flag that indicate manifest processing option</param>
/// <param name="importModuleOptions">The set of options that are used while importing a module</param>
/// <param name="found">True if a module was found</param>
/// <returns></returns>
internal PSModuleInfo LoadUsingMultiVersionModuleBase(string moduleBase, ImportModuleOptions importModuleOptions, out bool found)
internal PSModuleInfo LoadUsingMultiVersionModuleBase(string moduleBase, ManifestProcessingFlags manifestProcessingFlags, ImportModuleOptions importModuleOptions, out bool found)
{
PSModuleInfo foundModule = null;
found = false;
Expand Down Expand Up @@ -465,9 +466,7 @@ internal PSModuleInfo LoadUsingMultiVersionModuleBase(string moduleBase, ImportM
null,
this.BasePrefix, /*SessionState*/ null,
importModuleOptions,
ManifestProcessingFlags.LoadElements |
ManifestProcessingFlags.WriteErrors |
ManifestProcessingFlags.NullOnFirstError,
manifestProcessingFlags,
out found);
if (found)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ protected override void ProcessRecord()
{
foreach (ModuleSpecification requiredModule in requiredModules)
{
var modules = GetModule(new[] { requiredModule.Name }, true, true);
var modules = GetModule(new[] { requiredModule.Name }, false, true);
if (modules.Count == 0)
{
string errorMsg = StringUtil.Format(Modules.InvalidRequiredModulesinModuleManifest, requiredModule.Name, filePath);
Expand Down