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.
2 parents 3eb56c6 + 83d6d5f commit a05dbaeCopy full SHA for a05dbae
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