Skip to content

Commit 563c0a2

Browse files
author
Kapil Borle
committed
Move module script extension check to Helper
1 parent 5a9083f commit 563c0a2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Engine/Helper.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,6 +1775,19 @@ public static bool IsPowerShellVersionSupported(Version version)
17751775
return version >= minSupportedPSVersion;
17761776
}
17771777

1778+
/// <summary>
1779+
/// Determines if analyzing a script module.
1780+
/// </summary>
1781+
/// <returns>True is file name ends with ".psm1"</returns>
1782+
public static bool IsModuleScript(string filepath)
1783+
{
1784+
if (filepath == null)
1785+
{
1786+
throw new ArgumentNullException("filepath");
1787+
}
1788+
return filepath.EndsWith(".psm1");
1789+
}
1790+
17781791
/// <summary>
17791792
/// Checks if a given file is a valid PowerShell module manifest
17801793
/// </summary>

0 commit comments

Comments
 (0)