Skip to content
Merged
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 @@ -884,6 +884,11 @@ internal static CommandInfo LookupCommandInfo(

internal static void AutoloadModulesWithJobSourceAdapters(System.Management.Automation.ExecutionContext context, CommandOrigin commandOrigin)
{
/* This function is used by *-Job cmdlets (JobCmdletBase.BeginProcessing(), StartJobCommand.BeginProcessing())
It attempts to load modules from a fixed ModulesWithJobSourceAdapters list that currently has only `PSScheduledJob` module that is not PS-Core compatible.
Because this function does not check the result of a (currently failing) `PSScheduledJob` module autoload, it provides no value.
After discussion it was decided to comment out this code as it may be useful if ModulesWithJobSourceAdapters list changes in the future.

if (!context.IsModuleWithJobSourceAdapterLoaded)
{
PSModuleAutoLoadingPreference moduleAutoLoadingPreference = GetCommandDiscoveryPreference(context, SpecialVariables.PSModuleAutoLoadingPreferenceVarPath, "PSModuleAutoLoadingPreference");
Expand All @@ -906,7 +911,7 @@ internal static void AutoloadModulesWithJobSourceAdapters(System.Management.Auto
context.IsModuleWithJobSourceAdapterLoaded = true;
}
}
}
}*/
}

internal static Collection<PSModuleInfo> AutoloadSpecifiedModule(string moduleName, ExecutionContext context, SessionStateEntryVisibility visibility, out Exception exception)
Expand Down