Skip to content

Commit 84079a9

Browse files
author
Quoc Truong
committed
Allow scriptanalyzer to accept configuration in the form of a hashtable
1 parent 00e3be3 commit 84079a9

File tree

6 files changed

+357
-131
lines changed

6 files changed

+357
-131
lines changed

Engine/Commands/InvokeScriptAnalyzerCommand.cs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,18 @@ public SwitchParameter SuppressedOnly
169169
private bool suppressedOnly;
170170

171171
/// <summary>
172-
/// Returns path to the file that contains user profile for ScriptAnalyzer
172+
/// Returns path to the file that contains user profile or hash table for ScriptAnalyzer
173173
/// </summary>
174174
[Alias("Profile")]
175175
[Parameter(Mandatory = false)]
176176
[ValidateNotNull]
177-
public string Configuration
177+
public object Configuration
178178
{
179179
get { return configuration; }
180180
set { configuration = value; }
181181
}
182-
private string configuration;
182+
183+
private object configuration;
183184

184185
private bool stopProcessing;
185186

@@ -208,8 +209,7 @@ protected override void BeginProcessing()
208209
this.excludeRule,
209210
this.severity,
210211
null == rulePaths ? true : this.includeDefaultRules,
211-
this.suppressedOnly,
212-
this.configuration);
212+
this.suppressedOnly);
213213
}
214214

215215
/// <summary>
@@ -238,6 +238,18 @@ protected override void ProcessRecord()
238238
}
239239
}
240240

241+
protected override void EndProcessing()
242+
{
243+
ScriptAnalyzer.Instance.CleanUp();
244+
base.EndProcessing();
245+
}
246+
247+
protected override void StopProcessing()
248+
{
249+
ScriptAnalyzer.Instance.CleanUp();
250+
base.StopProcessing();
251+
}
252+
241253
#endregion
242254

243255
#region Methods

0 commit comments

Comments
 (0)