File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -289,7 +289,14 @@ function Start-ScriptAnalyzerBuild
289
289
function Test-ScriptAnalyzer
290
290
{
291
291
[CmdletBinding ()]
292
- param ( [Parameter ()][switch ]$InProcess , [switch ]$ShowAll )
292
+ param (
293
+ [Parameter ()]
294
+ [switch ]$InProcess ,
295
+
296
+ [switch ]$ShowAll ,
297
+
298
+ [string ]$RuleToTest
299
+ )
293
300
294
301
END {
295
302
# versions 3 and 4 don't understand versioned module paths, so we need to rename the directory of the version to
@@ -319,7 +326,12 @@ function Test-ScriptAnalyzer
319
326
$testModulePath = Join-Path " ${projectRoot} " - ChildPath out
320
327
}
321
328
$testResultsFile = " '$ ( Join-Path ${projectRoot} - childPath TestResults.xml) '"
322
- $testScripts = " '${projectRoot} \Tests\Engine','${projectRoot} \Tests\Rules','${projectRoot} \Tests\Documentation'"
329
+ if ($RuleToTest ) {
330
+ $testScripts = Get-Childitem - Path " ${projectRoot} \Tests\Rules" - Filter * $RuleToTest * .tests.ps1 | Select-Object - ExpandProperty FullName
331
+ }
332
+ else {
333
+ $testScripts = " '${projectRoot} \Tests\Engine','${projectRoot} \Tests\Rules','${projectRoot} \Tests\Documentation'"
334
+ }
323
335
try {
324
336
if ( $major -lt 5 ) {
325
337
Rename-Item $script :destinationDir ${testModulePath}
You can’t perform that action at this time.
0 commit comments