GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix minor CodeFactor style issues in ModuleCmdletBase by RDIL · Pull Request #9915 · PowerShell/PowerShell

Fix minor CodeFactor style issues in ModuleCmdletBase #9915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Aditya Patwardhan (adityapatwardhan) merged 2 commits into PowerShell:master from RDIL:patch-5
Jun 19, 2019

Uh oh!

There was an error while loading. Please reload this page.

Merged

Fix minor CodeFactor style issues in ModuleCmdletBase #9915

Changes from all commits
Commits
Show all changes
2 commits
Select commit Hold shift + click to select a range
feeebf5
Fix minor codefactor style issues in ModuleCmdletBase
RDIL Jun 17, 2019
66f8b4e
one line
RDIL Jun 18, 2019
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

19 changes: 2 additions & 17 deletions 19 src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs
Show comments
View file
Open in desktop
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
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.