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 @@ -585,7 +585,6 @@ private bool ValidateManifestHash(
// Check for PowerShell Version before checking other keys
// If a PowerShellVersion exists and does not match the requirements, then the error is InsufficientPowerShellVersion
// Else, the error is InvalidManifestMember

Version powerShellVersion;
Version currentPowerShellVersion = PSVersionInfo.PSVersion;
if (GetScalarFromData<Version>(data, moduleManifestPath, "PowerShellVersion", manifestProcessingFlags, out powerShellVersion) &&
Expand Down Expand Up @@ -1482,21 +1481,16 @@ internal PSModuleInfo LoadModuleManifest(

// START: Check if the ModuleToProcess is already loaded..if it is, ignore the this load manifest
// call and return

string moduleToProcess = null;

if (
!GetScalarFromData<string>(data, moduleManifestPath, "ModuleToProcess", manifestProcessingFlags,
out moduleToProcess))
if (!GetScalarFromData<string>(data, moduleManifestPath, "ModuleToProcess", manifestProcessingFlags, out moduleToProcess))
{
containedErrors = true;
if (bailOnFirstError) return null;
}

string rootModule = null;
if (
!GetScalarFromData<string>(data, moduleManifestPath, "RootModule", manifestProcessingFlags,
out rootModule))
if (!GetScalarFromData<string>(data, moduleManifestPath, "RootModule", manifestProcessingFlags, out rootModule))
{
containedErrors = true;
if (bailOnFirstError) return null;
Expand Down Expand Up @@ -1651,7 +1645,6 @@ internal PSModuleInfo LoadModuleManifest(
}

// END: Check if the ModuleToProcess is already loaded..

string author = string.Empty;
if (!GetScalarFromData(data, moduleManifestPath, "Author", manifestProcessingFlags, out author))
{
Expand Down Expand Up @@ -4474,9 +4467,7 @@ private void SetModuleLoggingInformation(ModuleLoggingGroupPolicyStatus status,
// After input from GP team for this behavior, need to revisit the commented out part
// if ((status & ModuleLoggingGroupPolicyStatus.Enabled) != 0)
// {

// }

if (((status & ModuleLoggingGroupPolicyStatus.Enabled) != 0) && moduleNames != null)
{
foreach (string currentGPModuleName in moduleNames)
Expand Down Expand Up @@ -4927,7 +4918,6 @@ internal void RemoveModule(PSModuleInfo module, string moduleNameInRemoveModuleC
// First remove cmdlets from the session state
// (can't just go through module.ExportedCmdlets
// because the names of the cmdlets might have been changed by the -Prefix parameter of Import-Module)

List<string> keysToRemoveFromCmdletCache = new List<string>();
foreach (KeyValuePair<string, List<CmdletInfo>> cmdlet in Context.EngineSessionState.GetCmdletTable())
{
Expand Down Expand Up @@ -6009,7 +5999,6 @@ private static bool ShouldProcessScriptModule(PSModuleInfo parentModule, ref boo

// If we are in module analysis and the parent module declares non-wildcarded exports, then we don't need to
// actually process the script module.

if (parentModule != null)
{
if (shouldProcessModule && (parentModule.DeclaredFunctionExports != null) && (parentModule.DeclaredFunctionExports.Count > 0))
Expand Down Expand Up @@ -6545,7 +6534,6 @@ internal PSModuleInfo LoadBinaryModule(PSModuleInfo parentModule, bool trySnapIn
// Passing module as a parameter here so that the providers can have the module property populated.
// For engine providers, the module should point to top-level module name
// For FileSystem, the module is Microsoft.PowerShell.Core and not System.Management.Automation

if (parentModule != null && InitialSessionState.IsEngineModule(parentModule.Name))
{
iss.ImportCmdletsFromAssembly(assemblyToLoad, parentModule);
Expand Down Expand Up @@ -6653,7 +6641,6 @@ internal PSModuleInfo LoadBinaryModule(PSModuleInfo parentModule, bool trySnapIn
// Passing module as a parameter here so that the providers can have the module property populated.
// For engine providers, the module should point to top-level module name
// For FileSystem, the module is Microsoft.PowerShell.Core and not System.Management.Automation

if (parentModule != null && InitialSessionState.IsEngineModule(parentModule.Name))
{
iss.ImportCmdletsFromAssembly(assembly, parentModule);
Expand Down Expand Up @@ -6696,7 +6683,6 @@ internal PSModuleInfo LoadBinaryModule(PSModuleInfo parentModule, bool trySnapIn
}

// Add the types table entries

List<string> typesFileNames = new List<string>();
foreach (SessionStateTypeEntry sste in iss.Types)
{
Expand All @@ -6709,7 +6695,6 @@ internal PSModuleInfo LoadBinaryModule(PSModuleInfo parentModule, bool trySnapIn
}

// Add the format file entries

List<string> formatsFileNames = new List<string>();
foreach (SessionStateFormatEntry ssfe in iss.Formats)
{
Expand Down