Skip to content

Commit efc027a

Browse files
committed
Merge pull request #149 from PowerShell/ModuleManifestBugFix
Suppress warnings emitted during the execution of Test-ModuleManifest
2 parents 1778d2a + 818108a commit efc027a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Rules/MissingModuleManifestField.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
using System;
1414
using System.Collections.Generic;
15+
using System.Collections.ObjectModel;
1516
using System.Management.Automation.Language;
1617
using System.Management.Automation;
1718
using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic;
@@ -44,6 +45,10 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
4445
{
4546
ps.AddCommand("Test-ModuleManifest");
4647
ps.AddParameter("Path", fileName);
48+
49+
// Suppress warnings emitted during the execution of Test-ModuleManifest
50+
// ModuleManifest rule must catch any violations (warnings/errors) and generate DiagnosticRecord(s)
51+
ps.AddParameter("WarningAction", ActionPreference.SilentlyContinue);
4752
ps.Invoke();
4853

4954
} catch { }

0 commit comments

Comments
 (0)