diff --git a/Engine/Commands/InvokeScriptAnalyzerCommand.cs b/Engine/Commands/InvokeScriptAnalyzerCommand.cs index c51fc9f38..e7c800f54 100644 --- a/Engine/Commands/InvokeScriptAnalyzerCommand.cs +++ b/Engine/Commands/InvokeScriptAnalyzerCommand.cs @@ -325,11 +325,13 @@ protected override void BeginProcessing() ? rulePaths : rulePaths.Concat(settingsCustomRulePath).ToArray(); } - catch + catch (Exception exception) { - this.WriteWarning(String.Format(CultureInfo.CurrentCulture, Strings.SettingsNotParsable)); - stopProcessing = true; - return; + this.ThrowTerminatingError(new ErrorRecord( + exception, + "SETTINGS_ERROR", + ErrorCategory.InvalidData, + this.settings)); } ScriptAnalyzer.Instance.Initialize( @@ -357,7 +359,7 @@ protected override void ProcessRecord() { ProcessPath(); } - + #if !PSV3 // TODO Support dependency resolution for analyzing script definitions if (saveDscDependency)