We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3eb56c6 commit 83d6d5fCopy full SHA for 83d6d5f
Rules/AvoidDefaultTrueValueSwitchParameter.cs
@@ -39,7 +39,7 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
39
// Iterrates all ParamAsts and check if any are switch.
40
foreach (ParameterAst paramAst in paramAsts)
41
{
42
- if (paramAst.Attributes.Any(attr => string.Equals(attr.TypeName.GetReflectionType().FullName, "system.management.automation.switchparameter", StringComparison.OrdinalIgnoreCase))
+ if (paramAst.Attributes.Any(attr => attr.TypeName.GetReflectionType() == typeof(System.Management.Automation.SwitchParameter))
43
&& paramAst.DefaultValue != null && String.Equals(paramAst.DefaultValue.Extent.Text, "$true", StringComparison.OrdinalIgnoreCase))
44
45
yield return new DiagnosticRecord(
0 commit comments