Skip to content

Commit c909541

Browse files
authored
1 parent 908cf89 commit c909541

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+112
-104
lines changed

src/System.Management.Automation/engine/Attributes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ public ValidateRangeAttribute(ValidateRangeKind kind) : base()
10831083
_rangeKind = kind;
10841084
}
10851085

1086-
private void ValidateRange(object element, ValidateRangeKind rangeKind)
1086+
private static void ValidateRange(object element, ValidateRangeKind rangeKind)
10871087
{
10881088
Type commonType = GetCommonType(typeof(int), element.GetType());
10891089
if (commonType == null)

src/System.Management.Automation/engine/CmdletParameterBinderController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2450,7 +2450,7 @@ private void IgnoreOtherMandatoryParameterSets(uint otherMandatorySetsToBeIgnore
24502450
}
24512451
}
24522452

2453-
private uint NewParameterSetPromptingData(
2453+
private static uint NewParameterSetPromptingData(
24542454
Dictionary<uint, ParameterSetPromptingData> promptingData,
24552455
MergedCompiledCommandParameter parameter,
24562456
ParameterSetSpecificMetadata parameterSetMetadata,

src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ internal List<CompletionResult> GetResultHelper(CompletionContext completionCont
936936
}
937937

938938
// Helper method to auto complete hashtable key
939-
private List<CompletionResult> GetResultForHashtable(CompletionContext completionContext)
939+
private static List<CompletionResult> GetResultForHashtable(CompletionContext completionContext)
940940
{
941941
var lastAst = completionContext.RelatedAsts.Last();
942942
HashtableAst tempHashtableAst = null;
@@ -997,7 +997,7 @@ private List<CompletionResult> GetResultForHashtable(CompletionContext completio
997997
}
998998

999999
// Helper method to look for an incomplete assignment pair in hash table.
1000-
private bool CheckForPendingAssignment(HashtableAst hashTableAst)
1000+
private static bool CheckForPendingAssignment(HashtableAst hashTableAst)
10011001
{
10021002
foreach (var keyValue in hashTableAst.KeyValuePairs)
10031003
{
@@ -1065,7 +1065,7 @@ private static string GetFirstLineSubString(string stringToComplete, out bool ha
10651065
return stringToComplete;
10661066
}
10671067

1068-
private Tuple<ExpressionAst, StatementAst> GetHashEntryContainsCursor(
1068+
private static Tuple<ExpressionAst, StatementAst> GetHashEntryContainsCursor(
10691069
IScriptPosition cursor,
10701070
HashtableAst hashTableAst,
10711071
bool isCursorInString)
@@ -1356,7 +1356,7 @@ private static List<CompletionResult> GetResultForEnum(
13561356
return GetMatchedResults(allNames, completionContext);
13571357
}
13581358

1359-
private List<CompletionResult> GetResultForEnumPropertyValueOfDSCResource(
1359+
private static List<CompletionResult> GetResultForEnumPropertyValueOfDSCResource(
13601360
CompletionContext completionContext,
13611361
string stringToComplete,
13621362
ref int replacementIndex,
@@ -1643,7 +1643,7 @@ private List<CompletionResult> GetResultForString(CompletionContext completionCo
16431643
/// <param name="ast"></param>
16441644
/// <param name="keywordAst"></param>
16451645
/// <returns></returns>
1646-
private ConfigurationDefinitionAst GetAncestorConfigurationAstAndKeywordAst(
1646+
private static ConfigurationDefinitionAst GetAncestorConfigurationAstAndKeywordAst(
16471647
IScriptPosition cursorPosition,
16481648
Ast ast,
16491649
out DynamicKeywordStatementAst keywordAst)
@@ -1679,7 +1679,7 @@ private ConfigurationDefinitionAst GetAncestorConfigurationAstAndKeywordAst(
16791679
/// <param name="keywordAst"></param>
16801680
/// <param name="matched"></param>
16811681
/// <returns></returns>
1682-
private List<CompletionResult> GetResultForIdentifierInConfiguration(
1682+
private static List<CompletionResult> GetResultForIdentifierInConfiguration(
16831683
CompletionContext completionContext,
16841684
ConfigurationDefinitionAst configureAst,
16851685
DynamicKeywordStatementAst keywordAst,
@@ -2093,7 +2093,7 @@ private List<CompletionResult> GetResultForIdentifier(CompletionContext completi
20932093
return result;
20942094
}
20952095

2096-
private List<CompletionResult> GetResultForAttributeArgument(CompletionContext completionContext, ref int replacementIndex, ref int replacementLength)
2096+
private static List<CompletionResult> GetResultForAttributeArgument(CompletionContext completionContext, ref int replacementIndex, ref int replacementLength)
20972097
{
20982098
// Attribute member arguments
20992099
Type attributeType = null;

src/System.Management.Automation/engine/CommandDiscovery.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ internal CommandDiscovery(ExecutionContext context)
149149
/// <returns>
150150
/// True if the cmdlet is a special cmdlet that shouldn't be part of the discovery list. Or false otherwise.
151151
/// </returns>
152-
private bool IsSpecialCmdlet(Type implementingType)
152+
private static bool IsSpecialCmdlet(Type implementingType)
153153
{
154154
// These commands should never be put in the discovery list. They are an internal implementation
155155
// detail of the formatting and output component. That component uses these cmdlets by creating

src/System.Management.Automation/engine/CommandSearcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ private static bool checkPath(string path, string commandName)
842842
// Don't return commands to the user if that might result in:
843843
// - Trusted commands calling untrusted functions that the user has overridden
844844
// - Debug prompts calling internal functions that are likely to have code injection
845-
private bool ShouldSkipCommandResolutionForConstrainedLanguage(CommandInfo? result, ExecutionContext executionContext)
845+
private static bool ShouldSkipCommandResolutionForConstrainedLanguage(CommandInfo? result, ExecutionContext executionContext)
846846
{
847847
if (result == null)
848848
{

src/System.Management.Automation/engine/EnumExpressionEvaluator.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ internal override bool ExistEnum(object enumVal)
309309
return exist;
310310
}
311311

312-
private bool isUnsigned(Type type)
312+
private static bool isUnsigned(Type type)
313313
{
314314
return (type == typeof(ulong) || type == typeof(uint) || type == typeof(ushort) || type == typeof(byte));
315315
}
@@ -386,7 +386,7 @@ internal bool ExistsInExpression(T flagName)
386386
/// <returns>
387387
/// A generic list of tokenized input.
388388
/// </returns>
389-
private List<Token> TokenizeInput(string input)
389+
private static List<Token> TokenizeInput(string input)
390390
{
391391
List<Token> tokenList = new List<Token>();
392392
int _offset = 0;
@@ -412,7 +412,7 @@ private List<Token> TokenizeInput(string input)
412412
/// <param name="_offset">
413413
/// Current offset position for the string parser.
414414
/// </param>
415-
private void FindNextToken(string input, ref int _offset)
415+
private static void FindNextToken(string input, ref int _offset)
416416
{
417417
while (_offset < input.Length)
418418
{
@@ -439,7 +439,7 @@ private void FindNextToken(string input, ref int _offset)
439439
/// <returns>
440440
/// The next token on the input string
441441
/// </returns>
442-
private Token GetNextToken(string input, ref int _offset)
442+
private static Token GetNextToken(string input, ref int _offset)
443443
{
444444
StringBuilder sb = new StringBuilder();
445445
// bool singleQuoted = false;
@@ -522,7 +522,7 @@ private Token GetNextToken(string input, ref int _offset)
522522
/// <param name="tokenList">
523523
/// A list of tokenized input.
524524
/// </param>
525-
private void CheckSyntaxError(List<Token> tokenList)
525+
private static void CheckSyntaxError(List<Token> tokenList)
526526
{
527527
// Initialize, assuming preceded by OR
528528
TokenKind previous = TokenKind.Or;
@@ -577,7 +577,7 @@ private void CheckSyntaxError(List<Token> tokenList)
577577
/// <param name="tokenList">
578578
/// Tokenized list of the input string.
579579
/// </param>
580-
private Node ConstructExpressionTree(List<Token> tokenList)
580+
private static Node ConstructExpressionTree(List<Token> tokenList)
581581
{
582582
bool notFlag = false;
583583
Queue<Node> andQueue = new Queue<Node>();

src/System.Management.Automation/engine/InitialSessionState.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,7 +2584,7 @@ HashSet<CommandInfo> GetPublicCommands()
25842584
return null;
25852585
}
25862586

2587-
private string[] GetModulesForUnResolvedCommands(IEnumerable<string> unresolvedCommands, ExecutionContext context)
2587+
private static string[] GetModulesForUnResolvedCommands(IEnumerable<string> unresolvedCommands, ExecutionContext context)
25882588
{
25892589
Collection<string> modulesToImport = new Collection<string>();
25902590
HashSet<string> commandsToResolve = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
@@ -3072,7 +3072,7 @@ private RunspaceOpenModuleLoadException ProcessModulesToImport(
30723072
/// <param name="moduleName"></param>
30733073
/// <param name="context"></param>
30743074
/// <returns></returns>
3075-
private IEnumerable<CommandInfo> LookupCommands(
3075+
private static IEnumerable<CommandInfo> LookupCommands(
30763076
string commandPattern,
30773077
string moduleName,
30783078
ExecutionContext context)

src/System.Management.Automation/engine/ManagementObjectAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public WMIParameterInformation(string name, Type ty) : base(ty, true, null, fals
7777
/// <param name="dotnetBaseType"></param>
7878
/// <param name="shouldIncludeNamespace"></param>
7979
/// <returns></returns>
80-
private IEnumerable<string> GetTypeNameHierarchyFromDerivation(ManagementBaseObject managementObj,
80+
private static IEnumerable<string> GetTypeNameHierarchyFromDerivation(ManagementBaseObject managementObj,
8181
string dotnetBaseType, bool shouldIncludeNamespace)
8282
{
8383
StringBuilder type = new StringBuilder(200);

src/System.Management.Automation/engine/Modules/GetModuleCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ PSObject outputObject in
174174
}
175175
}
176176

177-
private PSModuleInfo GetModuleInfoForRemoteModuleWithoutManifest(RemoteDiscoveryHelper.CimModule cimModule)
177+
private static PSModuleInfo GetModuleInfoForRemoteModuleWithoutManifest(RemoteDiscoveryHelper.CimModule cimModule)
178178
{
179179
return new PSModuleInfo(cimModule.ModuleName, null, null);
180180
}

src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,7 @@ private static bool IsCmdletizationFile(RemoteDiscoveryHelper.CimModuleFile cimM
14011401
return cimModuleFile.FileCode == RemoteDiscoveryHelper.CimFileCode.CmdletizationV1;
14021402
}
14031403

1404-
private IEnumerable<string> CreateCimModuleFiles(
1404+
private static IEnumerable<string> CreateCimModuleFiles(
14051405
RemoteDiscoveryHelper.CimModule remoteCimModule,
14061406
RemoteDiscoveryHelper.CimFileCode fileCode,
14071407
Func<RemoteDiscoveryHelper.CimModuleFile, bool> filesFilter,
@@ -2076,7 +2076,7 @@ internal override IList<PSModuleInfo> ImportModulesUsingWinCompat(IEnumerable<st
20762076
return moduleProxyList;
20772077
}
20782078

2079-
private void SetModuleBaseForEngineModules(string moduleName, System.Management.Automation.ExecutionContext context)
2079+
private static void SetModuleBaseForEngineModules(string moduleName, System.Management.Automation.ExecutionContext context)
20802080
{
20812081
// Set modulebase of engine modules to point to $pshome
20822082
// This is so that Get-Help can load the correct help.

0 commit comments

Comments
 (0)