Skip to content

Commit a6e8b98

Browse files
authored
Skip the modules whoes version is less than 1.0.0 (#15527)
Co-authored-by: wyunchi-ms <[email protected]>
1 parent 5427057 commit a6e8b98

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tools/StaticAnalysis/BreakingChangeAnalyzer/BreakingChangeAnalyzer.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,19 @@ public void Analyze(
130130
}
131131

132132
var psd1 = manifestFiles.FirstOrDefault();
133+
134+
// Skip the modules whoes version is less than 1.0.0
135+
using (var ps = PowerShell.Create())
136+
{
137+
ps.AddCommand("Test-ModuleManifest").AddParameter("Path", psd1);
138+
var result = ps.Invoke();
139+
PSModuleInfo moduleInfo = result[0].BaseObject as PSModuleInfo;
140+
if (moduleInfo.Version.Major < 1)
141+
{
142+
return;
143+
}
144+
}
145+
133146
var parentDirectory = Directory.GetParent(psd1).FullName;
134147
var psd1FileName = Path.GetFileName(psd1);
135148

0 commit comments

Comments
 (0)