Skip to content
12 changes: 7 additions & 5 deletions Engine/Commands/InvokeScriptAnalyzerCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -357,7 +359,7 @@ protected override void ProcessRecord()
{
ProcessPath();
}

#if !PSV3
// TODO Support dependency resolution for analyzing script definitions
if (saveDscDependency)
Expand Down