Skip to content

Commit 8c597d0

Browse files
author
Kapil Borle
committed
Add module manifest check in AvoidUsingDeprecatedManifestFields
1 parent 903464a commit 8c597d0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Rules/AvoidUsingDeprecatedManifestFields.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
3939
{
4040
throw new ArgumentNullException(Strings.NullAstErrorMessage);
4141
}
42-
43-
if (String.Equals(System.IO.Path.GetExtension(fileName), ".psd1", StringComparison.OrdinalIgnoreCase))
42+
if (fileName == null)
43+
{
44+
yield break;
45+
}
46+
if (Helper.IsModuleManifest(fileName))
4447
{
4548
var ps = System.Management.Automation.PowerShell.Create();
4649
IEnumerable<PSObject> result = null;

0 commit comments

Comments
 (0)