From 1b6c3a25ceba1f03405c4ba7c096f2aceede49f6 Mon Sep 17 00:00:00 2001 From: "Raghu Shantha [MSFT]" Date: Thu, 25 Jun 2015 15:13:46 -0700 Subject: [PATCH] WriteVerbose only when analyzing valid powershell files --- Engine/Commands/InvokeScriptAnalyzerCommand.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/Commands/InvokeScriptAnalyzerCommand.cs b/Engine/Commands/InvokeScriptAnalyzerCommand.cs index 8936e2cd3..2fa611404 100644 --- a/Engine/Commands/InvokeScriptAnalyzerCommand.cs +++ b/Engine/Commands/InvokeScriptAnalyzerCommand.cs @@ -255,12 +255,12 @@ private void ProcessPath(string path) } } else if (File.Exists(path)) - { - WriteVerbose(string.Format(CultureInfo.CurrentCulture, Strings.VerboseFileMessage, path)); + { if ((path.Length > ps1Suffix.Length && path.Substring(path.Length - ps1Suffix.Length).Equals(ps1Suffix, StringComparison.OrdinalIgnoreCase)) || (path.Length > psm1Suffix.Length && path.Substring(path.Length - psm1Suffix.Length).Equals(psm1Suffix, StringComparison.OrdinalIgnoreCase)) || (path.Length > psd1Suffix.Length && path.Substring(path.Length - psd1Suffix.Length).Equals(psd1Suffix, StringComparison.OrdinalIgnoreCase))) { + WriteVerbose(string.Format(CultureInfo.CurrentCulture, Strings.VerboseFileMessage, path)); AnalyzeFile(path); } }