Skip to content

Commit 0f1f937

Browse files
committed
Merge pull request #256 from PowerShell/FileVerboseMessageBranch
WriteVerbose only when analyzing valid powershell files
2 parents 610b12c + 1b6c3a2 commit 0f1f937

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Engine/Commands/InvokeScriptAnalyzerCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,12 @@ private void ProcessPath(string path)
255255
}
256256
}
257257
else if (File.Exists(path))
258-
{
259-
WriteVerbose(string.Format(CultureInfo.CurrentCulture, Strings.VerboseFileMessage, path));
258+
{
260259
if ((path.Length > ps1Suffix.Length && path.Substring(path.Length - ps1Suffix.Length).Equals(ps1Suffix, StringComparison.OrdinalIgnoreCase)) ||
261260
(path.Length > psm1Suffix.Length && path.Substring(path.Length - psm1Suffix.Length).Equals(psm1Suffix, StringComparison.OrdinalIgnoreCase)) ||
262261
(path.Length > psd1Suffix.Length && path.Substring(path.Length - psd1Suffix.Length).Equals(psd1Suffix, StringComparison.OrdinalIgnoreCase)))
263262
{
263+
WriteVerbose(string.Format(CultureInfo.CurrentCulture, Strings.VerboseFileMessage, path));
264264
AnalyzeFile(path);
265265
}
266266
}

0 commit comments

Comments
 (0)