spelling: locals in src/System.Management.Automation/engine/Modules
This commit is contained in:
parent
ca440b92e5
commit
c724220af1
3 changed files with 25 additions and 25 deletions
|
@ -123,17 +123,17 @@ namespace System.Management.Automation
|
||||||
var hadFunctions = AddPsd1EntryToResult(result, moduleManifestProperties["FunctionsToExport"], CommandTypes.Function, ref sawWildcard);
|
var hadFunctions = AddPsd1EntryToResult(result, moduleManifestProperties["FunctionsToExport"], CommandTypes.Function, ref sawWildcard);
|
||||||
var hadAliases = AddPsd1EntryToResult(result, moduleManifestProperties["AliasesToExport"], CommandTypes.Alias, ref sawWildcard);
|
var hadAliases = AddPsd1EntryToResult(result, moduleManifestProperties["AliasesToExport"], CommandTypes.Alias, ref sawWildcard);
|
||||||
|
|
||||||
var analysisSuceeded = hadCmdlets && hadFunctions && hadAliases;
|
var analysisSucceeded = hadCmdlets && hadFunctions && hadAliases;
|
||||||
|
|
||||||
if (!analysisSuceeded && !sawWildcard && (hadCmdlets || hadFunctions))
|
if (!analysisSucceeded && !sawWildcard && (hadCmdlets || hadFunctions))
|
||||||
{
|
{
|
||||||
// If we're missing CmdletsToExport, that might still be OK, but only if we have a script module.
|
// If we're missing CmdletsToExport, that might still be OK, but only if we have a script module.
|
||||||
// Likewise, if we're missing FunctionsToExport, that might be OK, but only if we have a binary module.
|
// Likewise, if we're missing FunctionsToExport, that might be OK, but only if we have a binary module.
|
||||||
|
|
||||||
analysisSuceeded = !CheckModulesTypesInManifestAgainstExportedCommands(moduleManifestProperties, hadCmdlets, hadFunctions, hadAliases);
|
analysisSucceeded = !CheckModulesTypesInManifestAgainstExportedCommands(moduleManifestProperties, hadCmdlets, hadFunctions, hadAliases);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (analysisSuceeded)
|
if (analysisSucceeded)
|
||||||
{
|
{
|
||||||
var moduleCacheEntry = new ModuleCacheEntry
|
var moduleCacheEntry = new ModuleCacheEntry
|
||||||
{
|
{
|
||||||
|
|
|
@ -762,12 +762,12 @@ namespace Microsoft.PowerShell.Commands
|
||||||
Version version;
|
Version version;
|
||||||
if (Version.TryParse(subdirName, out version))
|
if (Version.TryParse(subdirName, out version))
|
||||||
{
|
{
|
||||||
var modueBaseWithoutVersion = Path.GetDirectoryName(tempModuleInfoFromVerification.ModuleBase);
|
var moduleBaseWithoutVersion = Path.GetDirectoryName(tempModuleInfoFromVerification.ModuleBase);
|
||||||
|
|
||||||
modulePath = new string[]
|
modulePath = new string[]
|
||||||
{
|
{
|
||||||
Path.GetDirectoryName(modueBaseWithoutVersion),
|
Path.GetDirectoryName(moduleBaseWithoutVersion),
|
||||||
modueBaseWithoutVersion
|
moduleBaseWithoutVersion
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1874,24 +1874,24 @@ namespace Microsoft.PowerShell.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test the required processor architecture
|
// Test the required processor architecture
|
||||||
ProcessorArchitecture requiredProcesorArchitecture;
|
ProcessorArchitecture requiredProcessorArchitecture;
|
||||||
if (
|
if (
|
||||||
!GetScalarFromData(data, moduleManifestPath, "ProcessorArchitecture", manifestProcessingFlags,
|
!GetScalarFromData(data, moduleManifestPath, "ProcessorArchitecture", manifestProcessingFlags,
|
||||||
out requiredProcesorArchitecture))
|
out requiredProcessorArchitecture))
|
||||||
{
|
{
|
||||||
containedErrors = true;
|
containedErrors = true;
|
||||||
if (bailOnFirstError) return null;
|
if (bailOnFirstError) return null;
|
||||||
}
|
}
|
||||||
else if ((requiredProcesorArchitecture != ProcessorArchitecture.None) &&
|
else if ((requiredProcessorArchitecture != ProcessorArchitecture.None) &&
|
||||||
(requiredProcesorArchitecture != ProcessorArchitecture.MSIL))
|
(requiredProcessorArchitecture != ProcessorArchitecture.MSIL))
|
||||||
{
|
{
|
||||||
bool isRunningOnArm = false;
|
bool isRunningOnArm = false;
|
||||||
ProcessorArchitecture currentArchitecture = PsUtils.GetProcessorArchitecture(out isRunningOnArm);
|
ProcessorArchitecture currentArchitecture = PsUtils.GetProcessorArchitecture(out isRunningOnArm);
|
||||||
|
|
||||||
// For ARM Architectures, we need to do additional string-level comparison
|
// For ARM Architectures, we need to do additional string-level comparison
|
||||||
if ((currentArchitecture != requiredProcesorArchitecture && !isRunningOnArm) ||
|
if ((currentArchitecture != requiredProcessorArchitecture && !isRunningOnArm) ||
|
||||||
(isRunningOnArm &&
|
(isRunningOnArm &&
|
||||||
!requiredProcesorArchitecture.ToString()
|
!requiredProcessorArchitecture.ToString()
|
||||||
.Equals(PsUtils.ArmArchitecture, StringComparison.OrdinalIgnoreCase)))
|
.Equals(PsUtils.ArmArchitecture, StringComparison.OrdinalIgnoreCase)))
|
||||||
{
|
{
|
||||||
containedErrors = true;
|
containedErrors = true;
|
||||||
|
@ -1901,7 +1901,7 @@ namespace Microsoft.PowerShell.Commands
|
||||||
? PsUtils.ArmArchitecture
|
? PsUtils.ArmArchitecture
|
||||||
: currentArchitecture.ToString();
|
: currentArchitecture.ToString();
|
||||||
message = StringUtil.Format(Modules.InvalidProcessorArchitecture,
|
message = StringUtil.Format(Modules.InvalidProcessorArchitecture,
|
||||||
actualCurrentArchitecture, moduleManifestPath, requiredProcesorArchitecture);
|
actualCurrentArchitecture, moduleManifestPath, requiredProcessorArchitecture);
|
||||||
InvalidOperationException ioe = new InvalidOperationException(message);
|
InvalidOperationException ioe = new InvalidOperationException(message);
|
||||||
ErrorRecord er = new ErrorRecord(ioe, "Modules_InvalidProcessorArchitecture",
|
ErrorRecord er = new ErrorRecord(ioe, "Modules_InvalidProcessorArchitecture",
|
||||||
ErrorCategory.ResourceUnavailable, moduleManifestPath);
|
ErrorCategory.ResourceUnavailable, moduleManifestPath);
|
||||||
|
@ -2527,7 +2527,7 @@ namespace Microsoft.PowerShell.Commands
|
||||||
manifestInfo.PowerShellHostName = requestedHostName;
|
manifestInfo.PowerShellHostName = requestedHostName;
|
||||||
manifestInfo.PowerShellHostVersion = requestedHostVersion;
|
manifestInfo.PowerShellHostVersion = requestedHostVersion;
|
||||||
manifestInfo.PowerShellVersion = powerShellVersion;
|
manifestInfo.PowerShellVersion = powerShellVersion;
|
||||||
manifestInfo.ProcessorArchitecture = requiredProcesorArchitecture;
|
manifestInfo.ProcessorArchitecture = requiredProcessorArchitecture;
|
||||||
manifestInfo.Prefix = resolvedCommandPrefix;
|
manifestInfo.Prefix = resolvedCommandPrefix;
|
||||||
if (assemblyList != null)
|
if (assemblyList != null)
|
||||||
{
|
{
|
||||||
|
@ -2540,8 +2540,8 @@ namespace Microsoft.PowerShell.Commands
|
||||||
{
|
{
|
||||||
foreach (var f in fileList)
|
foreach (var f in fileList)
|
||||||
{
|
{
|
||||||
string absuluteFilePath = GetAbsolutePath(moduleBase, f);
|
string absoluteFilePath = GetAbsolutePath(moduleBase, f);
|
||||||
manifestInfo.AddToFileList(absuluteFilePath);
|
manifestInfo.AddToFileList(absoluteFilePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (moduleList != null)
|
if (moduleList != null)
|
||||||
|
@ -2892,7 +2892,7 @@ namespace Microsoft.PowerShell.Commands
|
||||||
null, //SessionState
|
null, //SessionState
|
||||||
nestedModuleOptions,
|
nestedModuleOptions,
|
||||||
manifestProcessingFlags,
|
manifestProcessingFlags,
|
||||||
false, // addToParentModueIfFound
|
false, // addToParentModuleIfFound
|
||||||
out found);
|
out found);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3303,7 +3303,7 @@ namespace Microsoft.PowerShell.Commands
|
||||||
|
|
||||||
if (newManifestInfo.ProcessorArchitecture == ProcessorArchitecture.None)
|
if (newManifestInfo.ProcessorArchitecture == ProcessorArchitecture.None)
|
||||||
{
|
{
|
||||||
newManifestInfo.ProcessorArchitecture = requiredProcesorArchitecture;
|
newManifestInfo.ProcessorArchitecture = requiredProcessorArchitecture;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newManifestInfo.RequiredAssemblies == null || newManifestInfo.RequiredAssemblies.LongCount() == 0)
|
if (newManifestInfo.RequiredAssemblies == null || newManifestInfo.RequiredAssemblies.LongCount() == 0)
|
||||||
|
@ -3627,7 +3627,7 @@ namespace Microsoft.PowerShell.Commands
|
||||||
private readonly string _serviceCoreAssemblyFullName = "Microsoft.Powershell.Workflow.ServiceCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL";
|
private readonly string _serviceCoreAssemblyFullName = "Microsoft.Powershell.Workflow.ServiceCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL";
|
||||||
private readonly string _serviceCoreAssemblyShortName = "Microsoft.Powershell.Workflow.ServiceCore";
|
private readonly string _serviceCoreAssemblyShortName = "Microsoft.Powershell.Workflow.ServiceCore";
|
||||||
|
|
||||||
private PSModuleInfo LoadServiceCoreModule(PSModuleInfo parentModule, string moduleBase, SessionState ss, ImportModuleOptions nestedModuleOptions, ManifestProcessingFlags manifestProcessingFlags, bool addToParentModueIfFound, out bool found)
|
private PSModuleInfo LoadServiceCoreModule(PSModuleInfo parentModule, string moduleBase, SessionState ss, ImportModuleOptions nestedModuleOptions, ManifestProcessingFlags manifestProcessingFlags, bool addToParentModuleIfFound, out bool found)
|
||||||
{
|
{
|
||||||
SessionStateInternal oldSessionState = Context.EngineSessionState;
|
SessionStateInternal oldSessionState = Context.EngineSessionState;
|
||||||
|
|
||||||
|
@ -3663,7 +3663,7 @@ namespace Microsoft.PowerShell.Commands
|
||||||
// If found, add it to the parent's list of NestedModules
|
// If found, add it to the parent's list of NestedModules
|
||||||
if (found)
|
if (found)
|
||||||
{
|
{
|
||||||
if (addToParentModueIfFound)
|
if (addToParentModuleIfFound)
|
||||||
{
|
{
|
||||||
parentModule.AddNestedModule(nestedModule);
|
parentModule.AddNestedModule(nestedModule);
|
||||||
}
|
}
|
||||||
|
|
|
@ -881,9 +881,9 @@ namespace Microsoft.PowerShell.Commands
|
||||||
_exportedCmdlets = new string[] { "*" };
|
_exportedCmdlets = new string[] { "*" };
|
||||||
}
|
}
|
||||||
|
|
||||||
ValidateUriParamterValue(ProjectUri, "ProjectUri");
|
ValidateUriParameterValue(ProjectUri, "ProjectUri");
|
||||||
ValidateUriParamterValue(LicenseUri, "LicenseUri");
|
ValidateUriParameterValue(LicenseUri, "LicenseUri");
|
||||||
ValidateUriParamterValue(IconUri, "IconUri");
|
ValidateUriParameterValue(IconUri, "IconUri");
|
||||||
|
|
||||||
if (CompatiblePSEditions != null && (CompatiblePSEditions.Distinct(StringComparer.OrdinalIgnoreCase).Count() != CompatiblePSEditions.Count()))
|
if (CompatiblePSEditions != null && (CompatiblePSEditions.Distinct(StringComparer.OrdinalIgnoreCase).Count() != CompatiblePSEditions.Count()))
|
||||||
{
|
{
|
||||||
|
@ -1131,7 +1131,7 @@ namespace Microsoft.PowerShell.Commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ValidateUriParamterValue(Uri uri, string parameterName)
|
private void ValidateUriParameterValue(Uri uri, string parameterName)
|
||||||
{
|
{
|
||||||
Dbg.Assert(!String.IsNullOrWhiteSpace(parameterName), "parameterName should not be null or whitespace");
|
Dbg.Assert(!String.IsNullOrWhiteSpace(parameterName), "parameterName should not be null or whitespace");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue