Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions Engine/Commands/InvokeScriptAnalyzerCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,18 @@ public SwitchParameter SuppressedOnly
private bool suppressedOnly;

/// <summary>
/// Returns path to the file that contains user profile for ScriptAnalyzer
/// Returns path to the file that contains user profile or hash table for ScriptAnalyzer
/// </summary>
[Alias("Profile")]
[Parameter(Mandatory = false)]
[ValidateNotNull]
public string Configuration
public object Settings
{
get { return configuration; }
set { configuration = value; }
get { return settings; }
set { settings = value; }
}
private string configuration;

private object settings;

private bool stopProcessing;

Expand All @@ -195,7 +196,7 @@ protected override void BeginProcessing()
string[] rulePaths = Helper.ProcessCustomRulePaths(customRulePath,
this.SessionState, recurseCustomRulePath);

if (!ScriptAnalyzer.Instance.ParseProfile(this.configuration, this.SessionState.Path, this))
if (!ScriptAnalyzer.Instance.ParseProfile(this.settings, this.SessionState.Path, this))
{
stopProcessing = true;
return;
Expand All @@ -208,8 +209,7 @@ protected override void BeginProcessing()
this.excludeRule,
this.severity,
null == rulePaths ? true : this.includeDefaultRules,
this.suppressedOnly,
this.configuration);
this.suppressedOnly);
}

/// <summary>
Expand Down Expand Up @@ -238,6 +238,18 @@ protected override void ProcessRecord()
}
}

protected override void EndProcessing()
{
ScriptAnalyzer.Instance.CleanUp();
base.EndProcessing();
}

protected override void StopProcessing()
{
ScriptAnalyzer.Instance.CleanUp();
base.StopProcessing();
}

#endregion

#region Methods
Expand Down
Loading