Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 5 additions & 4 deletions Engine/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ internal set
/// </summary>
private Dictionary<Ast, VariableAnalysis> VariableAnalysisDictionary;

private string[] functionScopes = new string[] { "global:", "local:", "script:", "private:" };
private string[] functionScopes = new string[] { "global:", "local:", "script:", "private:"};

private string[] variableScopes = new string[] { "global:", "local:", "script:", "private:", "variable:", ":" };
private string[] variableScopes = new string[] { "global:", "local:", "script:", "private:", "variable:", ":"};

#endregion

Expand Down Expand Up @@ -419,7 +419,8 @@ private string NameWithoutScope(string name, string[] scopes)
foreach (string scope in scopes)
{
// trim the scope part
if (name.IndexOf(scope) == 0)
if (name.IndexOf(scope, StringComparison.OrdinalIgnoreCase) == 0)

{
return name.Substring(scope.Length);
}
Expand Down Expand Up @@ -3022,4 +3023,4 @@ public object VisitUsingExpression(UsingExpressionAst usingExpressionAst)
return null;
}
}
}
}
15 changes: 15 additions & 0 deletions Tests/Rules/GoodCmdlet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,21 @@ function global:Get-SimpleFunc*

}

function Local:Get-SimpleFunc*
{

}

function PRIVATE:Get-SimpleFunc*
{

}

function ScRiPt:Get-SimpleFunc*
{

}

<#
.Synopsis
Short description
Expand Down